fix(comparer): Issue #96 Phase II - Fix ID collisions in move markup#98
Open
fix(comparer): Issue #96 Phase II - Fix ID collisions in move markup#98
Conversation
…sions (Issue #96 Phase II) Root cause fix for Issue #96: FixUpRevMarkIds() was being called AFTER FixUpRevisionIds() and was overwriting w:del/w:ins IDs starting from 0, causing collisions with move element IDs that had already been assigned. Changes: - Remove redundant FixUpRevMarkIds() call - FixUpRevisionIds() already handles all revision element IDs correctly including ins, del, moveFrom, moveTo, and range markers - Restore DetectMoves default to true (move detection is now safe) - Add 3 comprehensive ID uniqueness tests: - MoveMarkup_AllRevisionIdsShouldBeUnique - MoveMarkup_MoveNamesShouldProperlyPairSourceAndDestination - MoveMarkup_WithMixedChanges_ShouldHaveUniqueIds - Update documentation to remove Phase I warnings Fixes #96
Adds comprehensive stress tests that verify the Issue #96 fix: - StressTest.cs: Creates documents with 50/100/200 paragraphs, 15/25/40 moves, and 30/50/100 other changes - Issue96ValidationTest.cs: Basic validation tests - Issue96BugReproduction.cs: Reproduces the original bug scenario - ShowMoveXml.cs: Displays move XML structure for debugging All tests validate: - Revision IDs are unique across all elements - Move names properly pair source and destination - OpenXML validation passes
Migrates the standalone stress tests from TestFiles/Issue96/ into the main xUnit test suite as parameterized Theory tests: - Small: 50 paragraphs, ~15 moves, ~30 changes - Medium: 100 paragraphs, ~25 moves, ~50 changes - Large: 200 paragraphs, ~40 moves, ~100 changes Each test validates: - All revision IDs are unique (no collisions) - Move names properly pair source/destination - OpenXML schema validation passes Uses fixed random seed (42) for reproducibility.
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.
Summary
FixUpRevMarkIds()was overwritingw:del/w:insIDs starting from 0 afterFixUpRevisionIds()had already assigned unique IDs, causing collisions with move element IDsFixUpRevMarkIds()call -FixUpRevisionIds()already handles all revision element IDs correctlyDetectMovesdefault totrue(move detection is now safe to use)Test plan
Fixes #96