Skip to content

Fix field batch version checking#26372

Merged
CraigMacomber merged 4 commits intomicrosoft:mainfrom
CraigMacomber:fixFieldBatchVersionChecking
Feb 6, 2026
Merged

Fix field batch version checking#26372
CraigMacomber merged 4 commits intomicrosoft:mainfrom
CraigMacomber:fixFieldBatchVersionChecking

Conversation

@CraigMacomber
Copy link
Copy Markdown
Contributor

Description

Fix possible false positive error. See changeset for details.

Reviewer Guidance

The review process is outlined on this wiki page.

@CraigMacomber CraigMacomber requested a review from a team as a code owner February 5, 2026 22:23
Copilot AI review requested due to automatic review settings February 5, 2026 22:23
@CraigMacomber CraigMacomber requested a review from a team as a code owner February 5, 2026 22:23
const encoded2 = codec2.encode([], context);

assert.deepEqual(codec1.decode(encoded1, context), []);
assert.deepEqual(codec1.decode(encoded2, context), []);
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Without this change, this test failed here.

Copy link
Copy Markdown
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 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 makeFieldBatchCodec to use the union schema EncodedFieldBatch instead 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 minVersionForCollab settings 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

@CraigMacomber CraigMacomber merged commit adad917 into microsoft:main Feb 6, 2026
31 checks passed
@CraigMacomber CraigMacomber deleted the fixFieldBatchVersionChecking branch February 6, 2026 06:01
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.
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.

3 participants