fix(trace_timeline): escape invalid XML characters in present titles #28352
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/28352"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by GalaxyGamingFR on 2026-11-30T09:05:59Z.
What
Slice and thread labels go through
escape_text(), which replaces characters XML does not allow with U+FFFD, but present-marker titles used onlyhtml.escape. A present string with a control character (for example"a"inargs.present) put the raw character into the SVG, and the page's SVG no longer parsed as XML. Present titles now useescape_text()too.The new test writes such a present event and checks the U+FFFD title and that the SVG parses with
xml.etree.ElementTree.Tested
Windows 11, Python 3.12. The new test fails on
mainwithAssertionError: '<title>Present a� at 0.005 ms</title>' not foundand passes with the fix.python tools/tests/test_trace_timeline.py(33 (1 skipped) tests) andpython tools/check_conventions.py --base origin/mainpass. No open pull request touchestools/trace_timeline.py.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)🤖 Generated with Claude Code
Summary by CodeRabbit
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-30T09:20:32Z.
Review: APPROVED
Reviewed — looks good
The change sanitizes present marker titles with the existing XML-safe escaping helper, and the reviewed source supports merging.
What I ran
Reviewed head
4092ee8a05112fb5ce016791af6b7e567e88320f. No commands or tests were run in this review session.Results
Findings
Blocking
None.
Non-blocking
None.
Not verified
The full contents of both changed files were not read; only the relevant source and test ranges were inspected. Runtime behavior and the author-reported test results were not independently verified.
files.jsonwas not available through the review reader, so excluded files were not verified.To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by ligmaSec on 2026-12-03T05:36:24Z.
Review: COMMENTED
All 33 trace-timeline tests passed at
dda108ddba. The new CLI case generated HTML from a trace with a NUL in a present name, verified the replacement character in the title, and parsed the resulting SVG as XML. Existing tests for invalid characters in labels also passed.AI-assisted: yes.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.