Avoid requiring a minVersionForCollab when codec write version selection is not needed.#26720
Open
CraigMacomber wants to merge 5 commits intomicrosoft:mainfrom
Open
Avoid requiring a minVersionForCollab when codec write version selection is not needed.#26720CraigMacomber wants to merge 5 commits intomicrosoft:mainfrom
CraigMacomber wants to merge 5 commits intomicrosoft:mainfrom
Conversation
…ion is not needed.
Contributor
There was a problem hiding this comment.
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
ClientVersionDispatchingCodecBuilderbuild options toICodecOptionsand addbuildDecoder(options)for decode-only scenarios. - Update schema decoding call sites to use
schemaCodecBuilder.buildDecoder(options)instead of supplying a dummyminVersionForCollab. - Update schema codec tests to stop passing
minVersionForCollabwhen 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.
packages/dds/tree/src/test/feature-libraries/schema-index/schemaSummarizer.spec.ts
Outdated
Show resolved
Hide resolved
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.
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.