fix(document-api): make tables tracked-mode capability honest#3742
Open
marekgit200 wants to merge 1 commit into
Open
fix(document-api): make tables tracked-mode capability honest#3742marekgit200 wants to merge 1 commit into
marekgit200 wants to merge 1 commit into
Conversation
c08ef01 to
64124bd
Compare
tables.insertRow/deleteRow/insertColumn/deleteColumn all reported capabilities().<op>.tracked=true, but only insertRow could produce a tracked change. The others silently applied direct edits under changeMode:'tracked', and tables.deleteRow physically removed the row with no w:del marker (data loss in suggesting mode). Root cause: the inline overlap compiler cannot represent tableRow insert/delete steps, and the review model only treats a whole-table insert/delete as decidable (structuralRowChanges.js). insertRow keeps tracked support: it stamps a rowInsert revision that exports as a w:ins marker, and rows from one call share a single revisionGroupId. deleteRow/insertColumn/deleteColumn now reject changeMode:tracked with CAPABILITY_UNAVAILABLE and report supportsTrackedMode:false. Reference docs regenerated. Closes superdoc-dev#3594
64124bd to
c8956da
Compare
Contributor
|
Thanks for this, @marekgit200. I refreshed the branch against current I also dropped one stale hunk because |
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.
What
capabilities().operations[op].trackedreportedtruefor four table operations, but onlytables.insertRowcould actually produce a tracked change. The other three silently applied direct edits when called withchangeMode: 'tracked'— andtables.deleteRowphysically removed the row with now:delmarker, i.e. data loss in suggesting mode.Why it happened
The inline overlap compiler can't represent
tableRowinsert/delete steps, and the review model (structuralRowChanges.js) only treats a whole-table insert/delete as a decidable change. So a row/column-level operation has no decidable tracked representation, and the tracked path failed closed to a direct apply.Changes
tables.insertRowkeeps tracked support — it stamps a structuralrowInsertrevision matching the importer shape (row-track-change.js), which exports asw:insinsidew:trPrso Word can accept/reject it. Rows inserted in one call now share a singlerevisionGroupId.tables.deleteRow/tables.insertColumn/tables.deleteColumnnow rejectchangeMode: 'tracked'withCAPABILITY_UNAVAILABLE(the existingrejectTrackedModeconvention) and reportsupportsTrackedMode: false.plan.executeas a plan-engine meta-op in the adapter conformance test — it was added to the contract without being exempted from per-operation vector coverage, which had left the suite red onmain.Behavior change (worth a reviewer's eye)
Calling those three ops in tracked mode now throws instead of silently succeeding, and their capability flag flips to
false. This trades a silent-wrong / data-loss path for a loud, honest one.Test plan
insertRowtracked stampsrowInsertand exportsw:ins; a multi-row insert shares onerevisionGroupId; direct mode does not stamp; the three sibling ops reject tracked mode withCAPABILITY_UNAVAILABLE.pnpm check:public(superdoc 14/14 + docapi 4/4),pnpm check:types, the adapter conformance + convenience suites, prettier, and eslint all pass.Closes #3594