Skip to content

refactor(firestore): Merge BsonBinaryData into Blob#13190

Open
wu-hui wants to merge 3 commits into
port-pr-2378from
port-pr-2381
Open

refactor(firestore): Merge BsonBinaryData into Blob#13190
wu-hui wants to merge 3 commits into
port-pr-2378from
port-pr-2381

Conversation

@wu-hui

@wu-hui wu-hui commented May 14, 2026

Copy link
Copy Markdown
Contributor

This PR stacks on PR #2378 and implements the refactoring to merge BsonBinaryData into Blob, as requested by the user.

@wu-hui wu-hui requested review from a team as code owners May 14, 2026 15:37

@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 merges the BsonBinaryData class into the Blob class, enabling Blob to represent both native binary data and BSON binary data with subtypes. The Firestore ordering logic has been updated to treat both types as BLOBs with a unified comparison mechanism. Review feedback suggests optimizing the blob comparison logic to avoid unnecessary memory allocations, removing the redundant isBson field, addressing inconsistencies in the toProto() method, and improving the efficiency of the toString() implementation for large data blobs.

@wu-hui wu-hui force-pushed the port-pr-2378 branch 2 times, most recently from adcf75b to c76cfd9 Compare May 14, 2026 19:35
This PR stacks on PR #2378 and implements the refactoring to merge BsonBinaryData into Blob, as requested by the user.
@wu-hui wu-hui force-pushed the port-pr-2381 branch 3 times, most recently from 82eb2b8 to e035c55 Compare June 25, 2026 13:29
…BSON binaries as native bytes

- Remove `isBson` property and field from the `Blob` class.
- Update `UserDataConverter` to serialize BSON binary subtype 0 as native `bytesValue` instead of wrapped map.
- Add unit tests verifying BSON binary subtype 0 roundtrips as standard bytes/Blob.
- Add local query ordering tests verifying BSON binary subtype 1 comparison and sorting order relative to native bytes.
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