Skip to content

fix: keep tracked-change revision ids in signed 32-bit range#427

Merged
jan-kubica merged 3 commits into
mainfrom
cursor/eigenpal-revision-ids-6b1a
Jul 19, 2026
Merged

fix: keep tracked-change revision ids in signed 32-bit range#427
jan-kubica merged 3 commits into
mainfrom
cursor/eigenpal-revision-ids-6b1a

Conversation

@jan-kubica

@jan-kubica jan-kubica commented Jul 19, 2026

Copy link
Copy Markdown
Contributor

Suggestion mode seeded w:ins/w:del revision ids from Date.now(), producing 13-digit w:id values that overflow the signed 32-bit range OOXML consumers read into. Exported documents then failed to open.

Changes

  • Mint revision ids from a document-seeded counter (revisionIds.ts), starting at 1
  • Seed the counter on EditorState.create and from seedCommentAllocator
  • Fold out-of-range ids at parse and serialize boundaries via normalizeRevisionId
  • Harden the comment id allocator against out-of-range seeds
Open in Web Open in Cursor 

Suggestion mode seeded w:ins/w:del ids from Date.now(), producing
13-digit values that overflow the signed 32-bit range consumers read
w:id into. Mint from a document-seeded counter and fold out-of-range
ids at parse/serialize boundaries. Port of eigenpal/docx-editor#1093.

Co-authored-by: Jan Kubica <jan-kubica@users.noreply.github.com>
@coderabbitai

coderabbitai Bot commented Jul 19, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@cursor[bot], you've reached your PR review limit, so we couldn't start this review.

Next review available in: 55 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 95392654-a608-4a29-aa00-65bedeb90a46

📥 Commits

Reviewing files that changed from the base of the PR and between 3229068 and a771505.

📒 Files selected for processing (19)
  • .changeset/revision-id-int32-bounds.md
  • api-reports/docx-core/model.api.md
  • packages/core/src/docx/paragraphParser.test.ts
  • packages/core/src/docx/paragraphParser.ts
  • packages/core/src/docx/runParser.ts
  • packages/core/src/docx/sectionParser.ts
  • packages/core/src/docx/serializer/paragraphSerializer.test.ts
  • packages/core/src/docx/serializer/paragraphSerializer.ts
  • packages/core/src/docx/serializer/runSerializer.ts
  • packages/core/src/docx/serializer/sectionPropertiesSerializer.ts
  • packages/core/src/docx/serializer/tableSerializer.ts
  • packages/core/src/docx/tableParser.ts
  • packages/core/src/prosemirror/commentIdAllocator.ts
  • packages/core/src/prosemirror/plugins/revisionIds.test.ts
  • packages/core/src/prosemirror/plugins/revisionIds.ts
  • packages/core/src/prosemirror/plugins/suggestionMode.ts
  • packages/docx-core/src/model/content.ts
  • packages/docx-core/src/model/document.ts
  • packages/docx-core/src/model/trackedChangeIds.test.ts
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch cursor/eigenpal-revision-ids-6b1a

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request ensures tracked-change revision IDs remain within the signed 32-bit integer range accepted by OOXML consumers by introducing ID normalization and replacing clock-based ID generation with a monotonic counter seeded from the document. The review feedback highlights two critical issues: first, using a module-level global counter in revisionIds.ts can cause ID collisions and document corruption in multi-editor environments; second, paragraph-mark revisions (pPrMark) are currently ignored during document seeding, which can also lead to ID collisions.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread packages/core/src/prosemirror/plugins/revisionIds.ts
Comment thread packages/core/src/prosemirror/plugins/revisionIds.ts
@cursor
cursor Bot marked this pull request as ready for review July 19, 2026 03:18
cursoragent and others added 2 commits July 19, 2026 03:20
Folio stores paragraph-mark revisions on pPrMark.info.id, not the
upstream pPrIns/pPrDel shape. Also commit the docx-core model API
snapshot for MAX_REVISION_ID / normalizeRevisionId.

Co-authored-by: Jan Kubica <jan-kubica@users.noreply.github.com>
CC: format:check failed on the pPrMark seeding follow-up.

Co-authored-by: Jan Kubica <jan-kubica@users.noreply.github.com>
@cursor

cursor Bot commented Jul 19, 2026

Copy link
Copy Markdown
Contributor

@coderabbitai review

@jan-kubica
jan-kubica merged commit 64f0737 into main Jul 19, 2026
8 checks passed
@jan-kubica
jan-kubica deleted the cursor/eigenpal-revision-ids-6b1a branch July 19, 2026 16:42
@github-actions github-actions Bot locked and limited conversation to collaborators Jul 19, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants