Skip to content

fix(comparer): Issue #96 Phase II - Fix ID collisions in move markup#98

Open
JSv4 wants to merge 3 commits intomainfrom
feature/issue-96-simplify-move-markup-phase-ii
Open

fix(comparer): Issue #96 Phase II - Fix ID collisions in move markup#98
JSv4 wants to merge 3 commits intomainfrom
feature/issue-96-simplify-move-markup-phase-ii

Conversation

@JSv4
Copy link
Owner

@JSv4 JSv4 commented Jan 22, 2026

Summary

  • Fixes the root cause of Issue Move operations cause Word 'unreadable content' warning #96: FixUpRevMarkIds() was overwriting w:del/w:ins IDs starting from 0 after FixUpRevisionIds() had already assigned unique IDs, causing collisions with move element IDs
  • Removes the redundant FixUpRevMarkIds() call - FixUpRevisionIds() already handles all revision element IDs correctly
  • Restores DetectMoves default to true (move detection is now safe to use)
  • Adds comprehensive stress tests to the xUnit test suite validating ID uniqueness with dozens of moves and hundreds of changes

Test plan

  • Existing move detection tests pass
  • New stress tests pass (Small/Medium/Large configurations)
  • All 3 stress test configurations validate:
    • All revision IDs are unique
    • Move names properly pair source/destination
    • OpenXML schema validation passes
  • Manual verification: Open stress test output files in Word to confirm no "unreadable content" warning

Fixes #96

JSv4 added 3 commits January 20, 2026 20:16
…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.
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.

Move operations cause Word 'unreadable content' warning

1 participant