Skip to content

fix: read legacy XML Session File filters with Newtonsoft again - #683

Merged
Hirogen merged 2 commits into
Developmentfrom
test/legacy-xml-session-file-filter
Jul 29, 2026
Merged

fix: read legacy XML Session File filters with Newtonsoft again#683
Hirogen merged 2 commits into
Developmentfrom
test/legacy-xml-session-file-filter

Conversation

@Hirogen

@Hirogen Hirogen commented Jul 29, 2026

Copy link
Copy Markdown
Collaborator

Covering the PersisterXML -> Decompose path end-to-end, the gap the #666
review left open, turned up a live bug rather than the clean pass it was
meant to pin.

The XML writer that produced these files serialised FilterParams with
Newtonsoft, which writes Color as "Black". PersisterXML.ReadFilter had
since been switched to System.Text.Json, which cannot read that back:
it throws, ReadFilter's catch swallows the exception, and the entry is
skipped. Every filter in every legacy XML Session File was therefore
dropped silently on load - FilterParamsList came back empty.

Reading with Newtonsoft restores symmetry with the writer, and with the
rest of the persistence stack (Persister, the columnizer and encoding
converters, and FilterParams.CurrentColumnizer's own JsonConverter
attribute are all Newtonsoft). A null payload is now skipped explicitly
rather than throwing.

The new test builds its fixture by serialising through Newtonsoft the way
the writer did, instead of hand-writing JSON - a hand-written payload is
a shape no LogExpert version ever wrote, and omitting Color is exactly
what would have hidden this. It fails against the previous reader with
zero entries parsed, and asserts Color survives alongside the [0] rule.

BRUNER Patrick added 2 commits July 29, 2026 11:41
Covering the PersisterXML -> Decompose path end-to-end, the gap the #666
review left open, turned up a live bug rather than the clean pass it was
meant to pin.

The XML writer that produced these files serialised FilterParams with
Newtonsoft, which writes Color as "Black". PersisterXML.ReadFilter had
since been switched to System.Text.Json, which cannot read that back:
it throws, ReadFilter's catch swallows the exception, and the entry is
skipped. Every filter in every legacy XML Session File was therefore
dropped silently on load - FilterParamsList came back empty.

Reading with Newtonsoft restores symmetry with the writer, and with the
rest of the persistence stack (Persister, the columnizer and encoding
converters, and FilterParams.CurrentColumnizer's own JsonConverter
attribute are all Newtonsoft). A null payload is now skipped explicitly
rather than throwing.

The new test builds its fixture by serialising through Newtonsoft the way
the writer did, instead of hand-writing JSON - a hand-written payload is
a shape no LogExpert version ever wrote, and omitting Color is exactly
what would have hidden this. It fails against the previous reader with
zero entries parsed, and asserts Color survives alongside the [0] rule.
@Hirogen
Hirogen merged commit 06334b1 into Development Jul 29, 2026
3 checks passed
@Hirogen
Hirogen deleted the test/legacy-xml-session-file-filter branch July 29, 2026 11:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant