Skip to content

[Issue] Avoid lots of uncessary exceptions during layout XML merge loading #39877

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

Open
2 tasks done
m2-assistant bot opened this issue Apr 30, 2025 · 6 comments · May be fixed by #37570
Open
2 tasks done

[Issue] Avoid lots of uncessary exceptions during layout XML merge loading #39877

m2-assistant bot opened this issue Apr 30, 2025 · 6 comments · May be fixed by #37570
Labels
Area: Framework Component: Frontend Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Priority: P3 May be fixed according to the position in the backlog. Reported on 2.4.x Indicates original Magento version for the Issue report. Reproduced on 2.4.x The issue has been reproduced on latest 2.4-develop branch

Comments

@m2-assistant
Copy link

m2-assistant bot commented Apr 30, 2025

This issue is automatically created based on existing pull request: #37570: Avoid lots of uncessary exceptions during layout XML merge loading


Description

  • Introduce a new function (for B/C compat we don't overwrite the protected _loadXmlString) to load and not throw an exception
  • Use it in extract handlers -> no need to catch the exception any more

Related Pull Requests

See also: justbetter/magento2-sentry#113

Fixed Issues (if relevant)

No magento issue created.

Manual testing scenarios (*)

  1. Install the sentry plugin
  2. Have some invalid XML there
  3. Exception is reported, even it is not necessary

Reason

When using tools like Sentry, because of there inner workings, such exceptions still might be reported. While this is not exactly the root cause, it's always cleaner to not throw an exception and immediately catch it, if invalid cases can happen often.

This might even improve performance a bit and improves developer's experience.

Remarks

There seems some invalid XML at that place in the code happen quite often - it might be also interesting to check if that can be avoided.

This is a simple, trivial change to the code and should not break anything, so hopefully this can get triaged quickly and without to much back-and-forth about the testing procedure :-)

Contribution checklist (*)

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • [not applicable] All new or changed code is covered with unit/integration tests (if applicable)
  • [not applicable] README.md files for modified modules are updated and included in the pull request if any README.md predefined sections require an update
  • [waiting] All automated tests passed successfully (all builds are green)
@m2-assistant m2-assistant bot added the Priority: P3 May be fixed according to the position in the backlog. label Apr 30, 2025
@ct-prd-projects-boards-automation ct-prd-projects-boards-automation bot moved this to Ready for Development in Low Priority Backlog Apr 30, 2025
@engcom-Dash
Copy link
Contributor

As mentioned in the comment #37570 (comment) we have tried to reproduced the issue and this issue has been reproducible to us.

Please refer to the below screenshot:

Image

Hence confirming the issue.

Thanks.

@engcom-Dash engcom-Dash added the Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed label May 5, 2025
@github-jira-sync-bot github-jira-sync-bot removed the Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed label May 5, 2025
@github-jira-sync-bot
Copy link

Unfortunately, not enough information was provided to create a Jira ticket. Please make sure you added the following label(s): Reproduced on 2.4.x, ^Area:.*

Once all required labels are present, please add Issue: Confirmed label again.

@engcom-Dash engcom-Dash added Reproduced on 2.4.x The issue has been reproduced on latest 2.4-develop branch Area: Frontend Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed labels May 5, 2025
@github-jira-sync-bot
Copy link

❌ Something went wrong. Cannot create Jira issue.

@engcom-Dash engcom-Dash added Reported on 2.4.x Indicates original Magento version for the Issue report. Area: Frontend Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Reproduced on 2.4.x The issue has been reproduced on latest 2.4-develop branch Component: Frontend and removed Area: Frontend Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Reproduced on 2.4.x The issue has been reproduced on latest 2.4-develop branch Reported on 2.4.x Indicates original Magento version for the Issue report. labels May 5, 2025
@github-jira-sync-bot
Copy link

❌ Something went wrong. Cannot create Jira issue.

@engcom-Dash engcom-Dash added Area: Framework Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed and removed Area: Frontend Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed labels May 5, 2025
@github-jira-sync-bot
Copy link

✅ Jira issue https://jira.corp.adobe.com/browse/AC-14580 is successfully created for this GitHub issue.

Copy link
Author

m2-assistant bot commented May 5, 2025

✅ Confirmed by @engcom-Dash. Thank you for verifying the issue.
Issue Available: @engcom-Dash, You will be automatically unassigned. Contributors/Maintainers can claim this issue to continue. To reclaim and continue work, reassign the ticket to yourself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Framework Component: Frontend Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Priority: P3 May be fixed according to the position in the backlog. Reported on 2.4.x Indicates original Magento version for the Issue report. Reproduced on 2.4.x The issue has been reproduced on latest 2.4-develop branch
Projects
Status: Ready for Development
Development

Successfully merging a pull request may close this issue.

2 participants