feat(ordered-collection): implement reSubmitSquashed hook (identity transform)#27407
feat(ordered-collection): implement reSubmitSquashed hook (identity transform)#27407anthony-murphy wants to merge 1 commit into
Conversation
|
Hi! Thank you for opening this PR. Want me to review it? Based on the diff (18 lines, 2 files), I've queued these reviewers:
How this works
|
|
Closing: this implements |
|
🔗 No broken links found! ✅ Your attention to detail is admirable. linkcheck output |
Deep ReviewReviewed commit Readiness: 8/10 — ALMOST READY The Path to Ready
Context for Reviewers
For human reviewer
|
| */ | ||
| protected override reSubmitSquashed(content: unknown, localOpMetadata: unknown): void { | ||
| this.reSubmitCore(content, localOpMetadata); | ||
| } |
There was a problem hiding this comment.
Deep Review: No regression test guards the strict-flag squashed-resubmit path this override exists to enable.
The PR description states the override exists because the base reSubmitSquashed "otherwise throws. Explicitly opting in protects this DDS from breaking when the flag is flipped" — i.e. the guarantee is that the strict AllowStagingModeWithoutSquashing=false path no longer throws for this DDS. No file under packages/dds/ordered-collection/src/test/ is touched in this PR. The ordered-collection fuzz defaults at fuzzUtils.ts:53-61 do not set testSquashResubmit, and ddsFuzzHarness.ts:688-690 shows that path only runs when explicitly enabled — so existing fuzz coverage doesn't exercise the strict-flag scenario either.
Without a targeted test, a future refactor of reSubmitCore or of the base SharedObject.reSubmitSquashed contract can silently re-break the strict-flag scenario for ConsensusOrderedCollection / ConsensusQueue / ConsensusStack without CI noticing — defeating the PR's stated purpose.
Suggested coverage in the eventual replacement PR:
- Add a focused unit spec in
packages/dds/ordered-collection/src/test/consensusOrderedCollection.spec.tsthat drives a mock runtime withallowStagingModeWithoutSquashing: false, stages anadd/acquire/complete/releasemix, triggers squashed resubmit, and asserts (a) no throw and (b) equivalent final queue +jobTrackingstate. - Optionally enable
testSquashResubmit: trueinfuzzUtils.tsfor ongoing fuzz coverage.
| * `add(secret) -> acquire -> complete` (or `add(secret) -> acquire -> release`) still | ||
| * transmits the `add` op on commit because identity squash replays it in order. Callers | ||
| * that need leak-free staging behavior for queue values should hold the `add` locally | ||
| * and only call `add` after committing the staging session. |
There was a problem hiding this comment.
Deep Review: The documented "Known leak" caveat ships without a tracking artifact.
The new TSDoc explicitly classifies the behavior as a leak: add(secret) -> acquire -> complete still transmits the add op on commit because identity squash replays it in order. The PR description also notes "Prep for upcoming DDS-wide staging-mode squash work" without a linked tracking item. The closest precedent on the same class — PR #25747, which added rollback under the same "consensus DDS = state only changes on ack" framing — anchored to [AB#47480].
Without a tracked handle, the caller-side workaround ("hold the add locally and only call add after committing the staging session") becomes tribal knowledge, and the documented data-confidentiality caveat is not auditable from the issue tracker.
Add an AB# or GitHub-issue link in the TSDoc (or PR description) covering both the leak-on-commit limitation and the broader DDS-wide staging-mode squash work this prep enables. Existing ordered-collection TODOs (e.g. consensusOrderedCollection.ts:110, consensusOrderedCollectionFactory.ts:80) use GitHub-issue style — either format works.
Description
Implements
SharedObjectCore.reSubmitSquashedonConsensusOrderedCollectionas the identity transform — each pending op is replayed in submit order viareSubmitCore.Why
ConsensusOrderedCollectionops (add/acquire/complete/release) participate in a server-ordered queue with externally observable positions. Collapsing pending ops would change the queue's observable state, so identity is the right squash.The base
reSubmitSquashedfalls back toreSubmitCoreonly while theFluid.SharedObject.AllowStagingModeWithoutSquashingflag is true; otherwise it throws. Explicitly opting in protects this DDS from breaking when the flag is flipped.A known limitation is noted in the implementation comment: a staging-mode sequence such as
add(secret) -> acquire -> completestill transmits theaddop on commit, because identity squash replays it in order. Callers that need leak-free staging for queue values should hold theaddlocally and only call it after committing the staging session.Notes
Updates
ordered-collection.legacy.beta.api.mdto reflect the newprotectedmember. These api-report files are normally generated; if CI's api-extractor disagrees with the change, regenerate viabuild:api-reportsand push a fixup.Prep for upcoming DDS-wide staging-mode squash work.