Fix serialization scrub/convert bugs and reduce per-value scrubbing allocations#1770
Merged
SimonCropp merged 5 commits intoJul 5, 2026
Conversation
SimonCropp
commented
Jul 5, 2026
Member
- Static ScrubMembers/ScrubMember/ScrubMembers(Type,names) now scrub instead of ignore (they delegated to Ignore*, silently removing the member rather than rendering it as {Scrubbed})
- VerifyJsonWriter: only apply the remove/newline-prefix trick for a multiline string in property position; in array position write the value directly so the ',' delimiter between items is preserved
- SerializationSettings copy constructor now copies OrderDictionaries, so DontSortDictionaries survives a per-test settings clone
- GetMemberConverter keeps iterating on a name miss instead of returning null from the first assignable type
- TupleConverter: iterate the flattened ITuple length so fully-named 8+ element tuples work, and reject nested named tuples with a clear message
- NumericId scrubbing keys on the value's invariant string instead of Convert.ToInt64, avoiding OverflowException for ulong/decimal/double/NaN and no longer collapsing distinct fractional values
- ApplyForPropertyValue fast-paths values that cannot change (no scrubbers, no '\r', shorter than the shortest replacement) to avoid the StringBuilder round-trip and directory-replacement scan; FindMatches bails when the builder is shorter than the shortest pair
- Cache the ImmutableArray IsDefaultOrEmpty getter per type; use StringComparison.Ordinal in collection detection
- Add tests for the above
…llocations
- Static ScrubMembers<T>/ScrubMember<T>/ScrubMembers(Type,names) now scrub
instead of ignore (they delegated to Ignore*, silently removing the member
rather than rendering it as {Scrubbed})
- VerifyJsonWriter: only apply the remove/newline-prefix trick for a multiline
string in property position; in array position write the value directly so the
',' delimiter between items is preserved
- SerializationSettings copy constructor now copies OrderDictionaries, so
DontSortDictionaries survives a per-test settings clone
- GetMemberConverter keeps iterating on a name miss instead of returning null
from the first assignable type
- TupleConverter: iterate the flattened ITuple length so fully-named 8+ element
tuples work, and reject nested named tuples with a clear message
- NumericId scrubbing keys on the value's invariant string instead of
Convert.ToInt64, avoiding OverflowException for ulong/decimal/double/NaN and
no longer collapsing distinct fractional values
- ApplyForPropertyValue fast-paths values that cannot change (no scrubbers, no
'\r', shorter than the shortest replacement) to avoid the StringBuilder
round-trip and directory-replacement scan; FindMatches bails when the builder
is shorter than the shortest pair
- Cache the ImmutableArray IsDefaultOrEmpty getter per type; use
StringComparison.Ordinal in collection detection
- Add tests for the above
…ue-scrubbing-allocations' of https://github.com/VerifyTests/Verify into Fix-serialization-scrub/convert-bugs-and-reduce-per-value-scrubbing-allocations
This was referenced Jul 6, 2026
Closed
Open
Open
This was referenced Jul 7, 2026
Bump Argon, DiffEngine, EmptyFiles and Verify
NServiceBusCommunity/NServiceBus.Community.Serilog#864
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.