Skip to content

refactor: Support BSON Binary in standard Blob#8147

Open
wu-hui wants to merge 11 commits into
mainfrom
refactor-bson-binary
Open

refactor: Support BSON Binary in standard Blob#8147
wu-hui wants to merge 11 commits into
mainfrom
refactor-bson-binary

Conversation

@wu-hui
Copy link
Copy Markdown
Contributor

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

This PR refactors the Firestore BSON Binary map representation support to reuse the standard Blob class.

Key Changes:

  1. Bson Types: New Bson type are supported via new types in the SDK, and extension of existing type (Blob).
  2. CustomClassMapper & Serialization: Modifies CustomClassMapper to deserialize standard and BSON binary Blobs directly.

milaGGL and others added 10 commits April 8, 2025 10:40
* initial code

* add unit tests

* add integration tests

* update tests

* update tests

* Update BsonTypesTest.java

* add more tests

* fix a bug in comparing decimal128 value

* resolve comments

* update the comment regarding decimal128 NotIn&NaN test

* update the Quadruple class

* resolve comments

* hide the Quadruple, QuadrupleBuilder from api.txt
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize the Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counterproductive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 12, 2026

📝 PRs merging into main branch

Our main branch should always be in a releasable state. If you are working on a larger change, or if you don't want this change to see the light of the day just yet, consider using a feature branch first, and only merge into the main branch when the code complete and ready to be released.

@google-oss-bot
Copy link
Copy Markdown
Collaborator

The public api surface has changed for the subproject firebase-firestore:
error: Added method com.google.firebase.firestore.Blob.createBsonBinary(byte[]) [AddedMethod]
error: Added method com.google.firebase.firestore.Blob.createBsonBinary(int,byte[]) [AddedMethod]
error: Added method com.google.firebase.firestore.Blob.getSubType() [AddedMethod]
error: Added method com.google.firebase.firestore.Blob.isBson() [AddedMethod]
error: Removed class com.google.firebase.firestore.BsonBinaryData [RemovedClass]
error: Removed method com.google.firebase.firestore.DocumentSnapshot.getBsonBinaryData(String) [RemovedMethod]

Please update the api.txt files for the subprojects being affected by this change by running ./gradlew ${subproject}:generateApiTxtFile. Also perform a major/minor bump accordingly.

@wu-hui wu-hui force-pushed the refactor-bson-binary branch from e2eb2f7 to c0db4f8 Compare May 12, 2026 15:34
@google-oss-bot
Copy link
Copy Markdown
Collaborator

The public api surface has changed for the subproject firebase-firestore:
error: Added method com.google.firebase.firestore.Blob.createBsonBinary(byte[]) [AddedMethod]
error: Added method com.google.firebase.firestore.Blob.createBsonBinary(int,byte[]) [AddedMethod]
error: Added method com.google.firebase.firestore.Blob.getSubType() [AddedMethod]
error: Added method com.google.firebase.firestore.Blob.isBson() [AddedMethod]
error: Removed class com.google.firebase.firestore.BsonBinaryData [RemovedClass]
error: Removed method com.google.firebase.firestore.DocumentSnapshot.getBsonBinaryData(String) [RemovedMethod]

Please update the api.txt files for the subprojects being affected by this change by running ./gradlew ${subproject}:generateApiTxtFile. Also perform a major/minor bump accordingly.

@wu-hui wu-hui force-pushed the refactor-bson-binary branch from c0db4f8 to 4b2f5b0 Compare May 12, 2026 17:23
@google-oss-bot
Copy link
Copy Markdown
Collaborator

The public api surface has changed for the subproject firebase-firestore:
error: Added method com.google.firebase.firestore.Blob.createBsonBinary(byte[]) [AddedMethod]
error: Added method com.google.firebase.firestore.Blob.createBsonBinary(int,byte[]) [AddedMethod]
error: Added method com.google.firebase.firestore.Blob.getSubType() [AddedMethod]
error: Added method com.google.firebase.firestore.Blob.isBson() [AddedMethod]
error: Removed class com.google.firebase.firestore.BsonBinaryData [RemovedClass]
error: Removed method com.google.firebase.firestore.DocumentSnapshot.getBsonBinaryData(String) [RemovedMethod]

Please update the api.txt files for the subprojects being affected by this change by running ./gradlew ${subproject}:generateApiTxtFile. Also perform a major/minor bump accordingly.

@wu-hui wu-hui force-pushed the refactor-bson-binary branch 2 times, most recently from 86695d7 to 96f9dcc Compare May 12, 2026 18:49
@google-oss-bot
Copy link
Copy Markdown
Collaborator

The public api surface has changed for the subproject firebase-firestore:
error: Added method com.google.firebase.firestore.Blob.createBsonBinary(byte[]) [AddedMethod]
error: Added method com.google.firebase.firestore.Blob.createBsonBinary(int,byte[]) [AddedMethod]
error: Added method com.google.firebase.firestore.Blob.getSubType() [AddedMethod]
error: Added method com.google.firebase.firestore.Blob.isBson() [AddedMethod]
error: Removed class com.google.firebase.firestore.BsonBinaryData [RemovedClass]
error: Removed method com.google.firebase.firestore.DocumentSnapshot.getBsonBinaryData(String) [RemovedMethod]

Please update the api.txt files for the subprojects being affected by this change by running ./gradlew ${subproject}:generateApiTxtFile. Also perform a major/minor bump accordingly.

1 similar comment
@google-oss-bot
Copy link
Copy Markdown
Collaborator

The public api surface has changed for the subproject firebase-firestore:
error: Added method com.google.firebase.firestore.Blob.createBsonBinary(byte[]) [AddedMethod]
error: Added method com.google.firebase.firestore.Blob.createBsonBinary(int,byte[]) [AddedMethod]
error: Added method com.google.firebase.firestore.Blob.getSubType() [AddedMethod]
error: Added method com.google.firebase.firestore.Blob.isBson() [AddedMethod]
error: Removed class com.google.firebase.firestore.BsonBinaryData [RemovedClass]
error: Removed method com.google.firebase.firestore.DocumentSnapshot.getBsonBinaryData(String) [RemovedMethod]

Please update the api.txt files for the subprojects being affected by this change by running ./gradlew ${subproject}:generateApiTxtFile. Also perform a major/minor bump accordingly.

@wu-hui wu-hui force-pushed the refactor-bson-binary branch from 96f9dcc to 393131e Compare May 12, 2026 19:48
@google-oss-bot
Copy link
Copy Markdown
Collaborator

The public api surface has changed for the subproject firebase-firestore:
error: Added method com.google.firebase.firestore.Blob.createBsonBinary(byte[]) [AddedMethod]
error: Added method com.google.firebase.firestore.Blob.createBsonBinary(int,byte[]) [AddedMethod]
error: Added method com.google.firebase.firestore.Blob.getSubType() [AddedMethod]
error: Added method com.google.firebase.firestore.Blob.isBson() [AddedMethod]
error: Removed class com.google.firebase.firestore.BsonBinaryData [RemovedClass]
error: Removed method com.google.firebase.firestore.DocumentSnapshot.getBsonBinaryData(String) [RemovedMethod]

Please update the api.txt files for the subprojects being affected by this change by running ./gradlew ${subproject}:generateApiTxtFile. Also perform a major/minor bump accordingly.

@wu-hui wu-hui force-pushed the refactor-bson-binary branch from 393131e to 1c2cff1 Compare May 12, 2026 20:47
@google-oss-bot
Copy link
Copy Markdown
Collaborator

The public api surface has changed for the subproject firebase-firestore:
error: Added method com.google.firebase.firestore.Blob.createBsonBinary(byte[]) [AddedMethod]
error: Added method com.google.firebase.firestore.Blob.createBsonBinary(int,byte[]) [AddedMethod]
error: Added method com.google.firebase.firestore.Blob.getSubType() [AddedMethod]
error: Added method com.google.firebase.firestore.Blob.isBson() [AddedMethod]
error: Removed class com.google.firebase.firestore.BsonBinaryData [RemovedClass]
error: Removed method com.google.firebase.firestore.DocumentSnapshot.getBsonBinaryData(String) [RemovedMethod]

Please update the api.txt files for the subprojects being affected by this change by running ./gradlew ${subproject}:generateApiTxtFile. Also perform a major/minor bump accordingly.

@wu-hui wu-hui force-pushed the refactor-bson-binary branch from 1c2cff1 to 7a5e4de Compare May 12, 2026 21:27
@google-oss-bot
Copy link
Copy Markdown
Collaborator

The public api surface has changed for the subproject firebase-firestore:
error: Added method com.google.firebase.firestore.Blob.createBsonBinary(byte[]) [AddedMethod]
error: Added method com.google.firebase.firestore.Blob.createBsonBinary(int,byte[]) [AddedMethod]
error: Added method com.google.firebase.firestore.Blob.getSubType() [AddedMethod]
error: Added method com.google.firebase.firestore.Blob.isBson() [AddedMethod]
error: Removed class com.google.firebase.firestore.BsonBinaryData [RemovedClass]
error: Removed method com.google.firebase.firestore.DocumentSnapshot.getBsonBinaryData(String) [RemovedMethod]

Please update the api.txt files for the subprojects being affected by this change by running ./gradlew ${subproject}:generateApiTxtFile. Also perform a major/minor bump accordingly.

@wu-hui wu-hui force-pushed the refactor-bson-binary branch from 7a5e4de to daeb0f4 Compare May 13, 2026 14:12
@google-oss-bot
Copy link
Copy Markdown
Collaborator

The public api surface has changed for the subproject firebase-firestore:
error: Added method com.google.firebase.firestore.Blob.createBsonBinary(byte[]) [AddedMethod]
error: Added method com.google.firebase.firestore.Blob.createBsonBinary(int,byte[]) [AddedMethod]
error: Added method com.google.firebase.firestore.Blob.getSubType() [AddedMethod]
error: Added method com.google.firebase.firestore.Blob.isBson() [AddedMethod]
error: Removed class com.google.firebase.firestore.BsonBinaryData [RemovedClass]
error: Removed method com.google.firebase.firestore.DocumentSnapshot.getBsonBinaryData(String) [RemovedMethod]

Please update the api.txt files for the subprojects being affected by this change by running ./gradlew ${subproject}:generateApiTxtFile. Also perform a major/minor bump accordingly.

@wu-hui wu-hui force-pushed the refactor-bson-binary branch from daeb0f4 to 413fe16 Compare May 13, 2026 15:14
@wu-hui wu-hui force-pushed the refactor-bson-binary branch from 413fe16 to 1be2c11 Compare May 13, 2026 15:15
@wu-hui wu-hui force-pushed the refactor-bson-binary branch from 1be2c11 to 883cca4 Compare May 13, 2026 15:16
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.

4 participants