Repository navigation
Conversation
xmldom warns whenever the source contains U+FFFD, and the metadata decoder treated every parser report as a well-formedness failure, so a capture whose metadata held a legal U+FFFD character was rejected as invalid input. The fatal TextDecoder already rejects invalid source bytes, so ignore only that warning; other warnings and errors still reject the archive.
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
|
* fix(comparison): preserve incomplete function call evidence Keep missing, unknown, partial and unresolved call relationships unknown in function comparisons and reconstruction claims. Aggregate IDA caller and callee coverage without overwriting uncertainty. Validate with 144 focused tests, typecheck/lint, docs checks and test discovery. Real providers were not verified; the full headless IDA session suite requires unavailable Windows native controls. * fix(comparison): recheck historical calls-only changes --------- Co-authored-by: morluto <76467478+morluto@users.noreply.github.com>
Own service-worker CDP registrations and retry failed teardown. Admit redaction and network metadata against remaining capture capacity, retain explicit omission reasons, and preserve source URL, redirect ancestry, caller-selected content, and historical capture values. Forward CLI cancellation through provider cleanup. Reviewed fixes: #2263, #2637, #2767, #2845, #2859, #2863, #2872, #2874, #2876, #2879, #2955, #2957, #2961, #3033. Validation: 25 current event/network source tests passed; earlier focused browser lanes passed 201 source tests and 176 boundary tests with two skips, plus 35 Python tests. Real browser/Windows lanes were not rerun. Playwright allocation before admission remains unbounded by these retention limits.
|
This change landed on main in f690571 (listed under "Reviewed fixes"), so I'm closing this PR. Thanks for reviewing it! |
|
Thanks @Dragolone for separating valid U+FFFD text from malformed SAZ XML. The current parser accepts well-formed metadata containing that character instead of treating the parser warning as a syntax failure (main). |
Summary
A SAZ capture is rejected as invalid input when any
raw/N_m.xmlmetadata member contains U+FFFD (REPLACEMENT CHARACTER), even though the XML is well-formed.xmldom 0.9.12 emits a
warning("Unicode replacement character detected, source encoding issues?") whenever the source text contains U+FFFD (lib/sax.js, start ofparse).decodeSazMetadatatreats everyonErrorreport, warnings included, as a well-formedness failure. U+FFFD is a legal XMLChar([#xE000-#xFFFD]). The decoder already uses a fatalTextDecoder, so a U+FFFD that reaches the parser was encoded in the source. It cannot be a decoding artifact, which is the case the warning is about.Related: #2601 asks for the opposite direction in the same handler, rejecting
&, NUL and surrogate references that are currently accepted. This PR does not change that behavior and does not conflict with it; it only stops rejecting one legal character. No issue covers this case: I searched for "SAZ metadata", "replacement character", "U+FFFD", "xmldom warning" and "Fiddler".Problem and expected behavior
Smallest trigger: metadata
<Session SID="1"><SessionFlags><SessionFlag N="ui-comments" V="caf�"/></SessionFlags></Session>(with a real U+FFFD) in an otherwise ordinary archive.rea inspect-web-network-capture fffd.saz saz --jsonreports{"category": "invalid_input", "code": "invalid_request"}, anddecodeSazMetadatathrows "SAZ metadata is not well-formed XML."total_records: 1, with the attribute value retained ascaf�.Expected per
docs/web-network-captures.md: malformed metadata fails validation; well-formed metadata is projected.Change and scope
The
onErrorhandler ignores only thewarningwhose message starts with "Unicode replacement character detected". Every other warning, error or fatal error still setsparseFailed, so malformed XML is still rejected. That includes documents that also contain U+FFFD, and xmldom reports some of them only as warnings: unquoted attributes, attributes without separating whitespace, mismatched elements.Not included: the stricter checks requested in #2601.
Contribution scope: an ordinary format-inspection correctness fix within existing boundaries; a maintainer scope decision is not applicable.
Contract and boundary impact
decodeSazMetadatainsrc/browser/history/SazMetadata.ts.docs/public/product-catalog.json), package, or installation impact: none.Expected effects (check known effects; use documentation-only on its own).
Unchecked items do not establish absence; leave uncertainties visible.
Evidence and regression coverage
src/browser/history/SazMetadata.test.ts:94072364cthe first test fails with "SAZ metadata is not well-formed XML."; the rejection cases pass on both base and fix.rea inspect-web-network-capture fffd.saz saz --json): before{"category": "invalid_input", "code": "invalid_request"}, afternormalized_result.total_records = 1.For evidence-bearing changes:
Validation performed
macOS (Apple silicon), Node 24.19.0.
npx vitest run src/browser/history/SazMetadata.test.tson the base — the retention test fails, the three rejection tests pass.npx vitest run src/browser/history/with the fix — 6 files, 103 tests passed.npm run build:cached && npx vitest run tests/boundary/browser/sazWebCapture.test.ts— 13 passed, 1 skipped.rea inspect-web-network-capturebefore/after as above.npm run verify:test-discovery— "Discovered all 1089 test files exactly once."npm run typecheck— passed.npx oxfmt --checkandnpx oxlinton both changed files — passed, no errors.npm run verify:module-boundaries— passed.Compatibility, safety, and release
Before merge
type(scope): outcome.