Skip to content

fix(firestore): read user data in internal pipeline proto serialization#9752

Merged
dlarocque merged 2 commits intomainfrom
dl/validate-internal-ppl
Mar 25, 2026
Merged

fix(firestore): read user data in internal pipeline proto serialization#9752
dlarocque merged 2 commits intomainfrom
dl/validate-internal-ppl

Conversation

@dlarocque
Copy link
Copy Markdown
Contributor

Adds a step to internalPipelineToExecutePipelineRequestProto to read user data before serialization. Fixes an in

This function was broken in #9715, and caused the console support tests to fail, which use this method to verify pipelines get serialized as expected.

       console support
         supports pipeline query serialization to proto:
     Error: FIRESTORE (12.10.0) INTERNAL ASSERTION FAILED: Value of this constant has not been serialized to proto value (ID: ed)
      at _fail (src/util/assert.ts:40:1)
      at hardAssert (src/util/assert.ts:61:31)
      at Constant._toProto (src/lite-api/expressions.ts:2449:1)
      at /Users/dlarocque/workspace/sdk/firebase-js-sdk/packages/firestore/src/lite-api/expressions.ts:2573:1
      at Array.map (<anonymous>)
      at FunctionExpression._toProto (src/lite-api/expressions.ts:2573:1)
      at BooleanFunctionExpression._toProto (src/lite-api/expressions.ts:2733:1)
      at Where._toProto (src/lite-api/stage.ts:91:24)
      at /Users/dlarocque/workspace/sdk/firebase-js-sdk/packages/firestore/src/lite-api/pipeline.ts:1027:1
      at Array.map (<anonymous>)
      at Pipeline._toProto (src/lite-api/pipeline.ts:1027:1)
      at StructuredPipeline._toProto (src/core/structured_pipeline.ts:8:1)
      at _internalPipelineToExecutePipelineRequestProto (src/remote/internal_serializer.ts:57:16)
      at Context.<anonymous> (test/integration/api_internal/pipeline.test.ts:71:67)
      at processImmediate (node:internal/timers:478:21)

These test failures weren't caught since they weren't run in CI, and were skipped when ran locally with test:lite and test:browser. I verified these tests now pass using test:node:prod.

This is an internal change, so I did not add a changelog entry.

Adds a step to `internalPipelineToExecutePipelineRequestProto` to read
user data before serialization.

This function was broken in
#9715, and caused the
`console support` tests to fail, which use this method to verify pipelines get serialized as expected.
These test failures weren't caught since
they weren't run in CI, and were skipped when ran locally with
`test:lite` and `test:browser`. I verified these tests now pass using
`test:node:prod`.
@dlarocque dlarocque requested a review from MarkDuckworth March 25, 2026 16:53
@dlarocque dlarocque requested review from a team as code owners March 25, 2026 16:53
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Mar 25, 2026

🦋 Changeset detected

Latest commit: 327f699

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages
Name Type
@firebase/firestore Patch
firebase Patch
@firebase/firestore-compat Patch

Not sure what this means? Click here to learn what changesets are.

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

@dlarocque dlarocque requested a review from hsubox76 March 25, 2026 16:53
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request addresses a critical internal serialization bug within the Firestore SDK that prevented proper conversion of pipeline data to its protocol buffer representation. By ensuring user data is correctly read before serialization, it restores the functionality of internal testing pipelines and prevents future regressions in this area, specifically fixing previously failing console support tests.

Highlights

  • Fixes pipeline proto serialization: Corrected an issue in internalPipelineToExecutePipelineRequestProto where user data was not read before serialization, leading to an INTERNAL ASSERTION FAILED error during proto serialization. This issue was introduced in a previous pull request (fix(firestore): read and write user data on pipeline execute #9715).
  • Restores console support test functionality: The fix resolves failures in console support tests that verify pipeline serialization, which were previously broken and not caught by standard CI or local test:lite/test:browser runs.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

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 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 counter productive. 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.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown
Contributor

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

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 user data reading capabilities into the internal pipeline serialization process. It imports newUserDataReader and UserDataSource, then initializes a UserDataReader and a context within the _internalPipelineToExecutePipelineRequestProto function to call pipeline._readUserData. There are no review comments to provide feedback on.

@dlarocque dlarocque requested a review from a team as a code owner March 25, 2026 17:34
@dlarocque dlarocque merged commit 4e99d4b into main Mar 25, 2026
43 of 44 checks passed
@dlarocque dlarocque deleted the dl/validate-internal-ppl branch March 25, 2026 18:17
@google-oss-bot google-oss-bot mentioned this pull request Apr 8, 2026
@firebase firebase locked and limited conversation to collaborators Apr 25, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants