Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Solves an issue where importing an XML file causes large portions of the file to be loaded in RAM #2055

Merged
merged 3 commits into from
Dec 5, 2024

Conversation

idlira
Copy link
Contributor

@idlira idlira commented Dec 5, 2024

Description

With the introduction of customer-scripting when loading XML files, we add a custom handler to process the events before calling the original handler, but unfortunately did not check if the original node handler was configured to ignore its contents (sub-tree). A use case for this: reading BMEcat's version from the root element, without having to load the entire file.

This change not only correctly cope with this case, but won't create this unnecessary handler if scripting is not active at all.

Additional Notes

  • This PR fixes or works on following ticket(s): OX-11723

Checklist

  • Code change has been tested and works locally
  • Code was formatted via IntelliJ and follows SonarLint & best practices

We were fitting a custom handler to process events after the loaded node all the time, even if we have no event to call.

Fixes: OX-11723
When adding a node handler, we must check if the original handler was set to ignore contents, otherwise, the entire sub-three will be loaded.

For example, trying to read the BMEcat version from the root element, we want to read this element alone and not the entire file.

Fixes: OX-11723
@idlira idlira added 🐛 Bugfix Contains only a small fix for an existing bug 🔥 Hotfix PRs that fix a major bug and can be hotfixed labels Dec 5, 2024
@idlira idlira merged commit e41b1ca into develop Dec 5, 2024
4 of 5 checks passed
@sabieber sabieber deleted the ili/HF_107.2.1 branch December 6, 2024 08:25
@jakobvogel jakobvogel restored the ili/HF_107.2.1 branch December 6, 2024 08:51
@jakobvogel jakobvogel deleted the ili/HF_107.2.1 branch December 6, 2024 09:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 Bugfix Contains only a small fix for an existing bug 🔥 Hotfix PRs that fix a major bug and can be hotfixed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants