Skip to content

Decimal128 Increment spec test - #10317

Open
dlarocque wants to merge 6 commits into
dl/bson-typesfrom
dl/bson-spec
Open

Decimal128 Increment spec test#10317
dlarocque wants to merge 6 commits into
dl/bson-typesfrom
dl/bson-spec

Conversation

@dlarocque

Copy link
Copy Markdown
Contributor

Added spec test for Decimal128 increment, verifying that

  1. Decimal128 can lose precision after local increment
  2. The correct Decimal128 increment result is overwritten when received from remote.

Added transformOperations to writeAck to allow transform operations to be part of the ack.

@dlarocque
dlarocque requested review from a team as code owners August 18, 2026 20:10
@changeset-bot

changeset-bot Bot commented Aug 18, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 7570d3b

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request introduces support for verifying server-side transform results in spec tests, specifically adding a test case for Decimal128 increment precision recovery upon server acknowledgment. It updates the spec builder and test runner to accept and propagate transformResults during write acknowledgments. The review feedback highlights a potential issue where hardcoding mutationResults to a single-element array will cause assertion failures for multi-mutation batches, and provides a code suggestion to dynamically construct the results array based on the mutation count.

Comment thread packages/firestore/test/unit/specs/spec_test_runner.ts
@dlarocque

Copy link
Copy Markdown
Contributor Author

/gemini review

@dlarocque
dlarocque requested review from wu-hui and removed request for a team August 26, 2026 14:43

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request implements a toJSON method for Decimal128Value to support JSON serialization. It also updates the spec test runner and builder to support transformResults in write acknowledgments, and adds unit tests verifying that Decimal128 increment operations correctly recover precision upon receiving server acknowledgments. I have no feedback to provide as there are no review comments.

@dlarocque
dlarocque requested a review from a team as a code owner August 26, 2026 15:38
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.

1 participant