Fix field batch version checking#26372
Merged
CraigMacomber merged 4 commits intomicrosoft:mainfrom Feb 6, 2026
Merged
Conversation
CraigMacomber
commented
Feb 5, 2026
| const encoded2 = codec2.encode([], context); | ||
|
|
||
| assert.deepEqual(codec1.decode(encoded1, context), []); | ||
| assert.deepEqual(codec1.decode(encoded2, context), []); |
Contributor
Author
There was a problem hiding this comment.
Without this change, this test failed here.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes a false positive error in the FormatValidator that occurred when clients with different MinimumVersionForCollab settings tried to encode and decode FieldBatch data. The issue arose because the codec validation schema was version-specific (either v1 or v2) based on the write version, preventing cross-version compatibility even though the encode/decode logic supported both versions.
Changes:
- Modified
makeFieldBatchCodecto use the union schemaEncodedFieldBatchinstead of version-specific schemas, enabling validation of both v1 and v2 formats regardless of the codec's write version - Added a test case to verify that codecs configured with different
minVersionForCollabsettings can decode each other's encoded data - Updated changeset documentation to explain the fix
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| packages/dds/tree/src/feature-libraries/chunked-forest/codec/codecs.ts | Replaced version-specific schema types with the union type EncodedFieldBatch to allow validation of both v1 and v2 formats, and added explanatory comments |
| packages/dds/tree/src/test/feature-libraries/chunked-forest/codec/codecs.spec.ts | Added test to verify cross-compatibility between codecs with different minVersionForCollab settings |
| .changeset/fluffy-hairs-itch.md | Documented the bug fix and its impact on users |
Josmithr
approved these changes
Feb 6, 2026
This was referenced Feb 6, 2026
CraigMacomber
added a commit
that referenced
this pull request
Feb 10, 2026
## Description Fixes the same bug that was fixed in #26372, except this time for the forest codec.
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
Fix possible false positive error. See changeset for details.
Reviewer Guidance
The review process is outlined on this wiki page.