Skip to content

Avoid requiring a minVersionForCollab when codec write version selection is not needed.#26720

Open
CraigMacomber wants to merge 5 commits intomicrosoft:mainfrom
CraigMacomber:LessMinVersionForCollab
Open

Avoid requiring a minVersionForCollab when codec write version selection is not needed.#26720
CraigMacomber wants to merge 5 commits intomicrosoft:mainfrom
CraigMacomber:LessMinVersionForCollab

Conversation

@CraigMacomber
Copy link
Contributor

Description

We have a few places in our code where we don't actually need to select a write version, but require providing all the information needed to do so.

This change tweaks the types a bit and adds a buildDecoder option, removing the neww for thisunnecessary data.

Reviewer Guidance

The review process is outlined on this wiki page.

@CraigMacomber CraigMacomber requested a review from a team as a code owner March 13, 2026 18:51
Copilot AI review requested due to automatic review settings March 13, 2026 18:51
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR reduces required inputs when only decoding versioned persisted data by introducing a decoder-only build path, and updates several schema-related call sites/tests to use it instead of forcing minVersionForCollab-driven write-version selection.

Changes:

  • Generalize ClientVersionDispatchingCodecBuilder build options to ICodecOptions and add buildDecoder(options) for decode-only scenarios.
  • Update schema decoding call sites to use schemaCodecBuilder.buildDecoder(options) instead of supplying a dummy minVersionForCollab.
  • Update schema codec tests to stop passing minVersionForCollab when constructing per-format codecs.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
packages/dds/tree/src/test/snapshots/schema.spec.ts Stops passing minVersionForCollab when building per-format schema codecs in snapshot tests.
packages/dds/tree/src/test/feature-libraries/schema-index/schemaSummarizer.spec.ts Stops passing minVersionForCollab when building per-format schema codecs for snapshots.
packages/dds/tree/src/simple-tree/api/storedSchema.ts Uses schemaCodecBuilder.buildDecoder for decode-only schema comparisons.
packages/dds/tree/src/shared-tree/sharedTree.ts Uses schemaCodecBuilder.buildDecoder for decode-only persisted schema parsing.
packages/dds/tree/src/shared-tree/independentView.ts Uses decoder-only builders when initializing from provided content.
packages/dds/tree/src/codec/versioned/codec.ts Adds buildDecoder and updates type constraints to avoid requiring write-version inputs for decode-only usage.

You can also share your feedback on Copilot code review. Take the survey.

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.

2 participants