Skip to content

Conversation

@cherylEnkidu
Copy link
Contributor

Fixes #9378

Testing
Verify in integration test

@cherylEnkidu cherylEnkidu requested review from a team as code owners November 17, 2025 16:10
@changeset-bot
Copy link

changeset-bot bot commented Nov 17, 2025

🦋 Changeset detected

Latest commit: 3124bc9

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

@gemini-code-assist
Copy link

Summary of Changes

Hello @cherylEnkidu, 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 reported issue in the Firestore lite API by refining the error handling for the doc() function. The primary goal is to provide more precise and less misleading error messages to developers. Specifically, it introduces a dedicated error for undefined first arguments and corrects a typo in an existing argument validation error. These changes are accompanied by new integration tests to ensure the robustness and accuracy of the updated error messages.

Highlights

  • Improved Error Handling for doc(): The doc() function now explicitly checks if its first argument (parent) is undefined and throws a FirestoreError with a clear message: 'Function doc() cannot be called with an undefined first argument.'.
  • Corrected Misleading Error Message: An existing error message within the doc() function that validates the type of its first argument has been corrected. It now accurately refers to doc() instead of collection().
  • Enhanced Integration Tests: New integration tests have been added to verify the behavior of the doc() function when called with an undefined first argument and to confirm the correctness of the updated error message for invalid argument types.
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.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

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

@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 correctly addresses an issue where calling doc() with an undefined first argument resulted in a misleading error. It introduces a specific check for this case and throws a clear error message. Additionally, it fixes a separate incorrect error message within the same function. The new integration tests are valuable, but one of them contains a small discrepancy in the expected error message which should be corrected.

@cherylEnkidu cherylEnkidu requested a review from a team as a code owner November 17, 2025 16:13
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
@google-oss-bot
Copy link
Contributor

google-oss-bot commented Nov 17, 2025

Size Report 1

Affected Products

  • @firebase/firestore

    TypeBase (d1d898f)Merge (291aece)Diff
    browser391 kB391 kB-7 B (-0.0%)
    main611 kB611 kB-7 B (-0.0%)
    module391 kB391 kB-7 B (-0.0%)
    react-native392 kB392 kB-7 B (-0.0%)
  • @firebase/firestore-lite

    TypeBase (d1d898f)Merge (291aece)Diff
    browser115 kB115 kB-7 B (-0.0%)
    main158 kB158 kB-7 B (-0.0%)
    module115 kB115 kB-7 B (-0.0%)
    react-native116 kB116 kB-7 B (-0.0%)
  • bundle

    TypeBase (d1d898f)Merge (291aece)Diff
    firestore (Query Cursors)257 kB257 kB-7 B (-0.0%)
    firestore (Read data once)245 kB245 kB-7 B (-0.0%)
    firestore (Read Write w Persistence)338 kB337 kB-7 B (-0.0%)
    firestore (Realtime updates)245 kB245 kB-7 B (-0.0%)
    firestore (Transaction)223 kB223 kB-7 B (-0.0%)
    firestore (Write data)224 kB224 kB-7 B (-0.0%)
    firestore-lite (Query Cursors)110 kB110 kB-7 B (-0.0%)
    firestore-lite (Read data once)81.6 kB81.6 kB-7 B (-0.0%)
    firestore-lite (Transaction)107 kB107 kB-7 B (-0.0%)
    firestore-lite (Write data)91.1 kB91.1 kB-7 B (-0.0%)
  • firebase

    TypeBase (d1d898f)Merge (291aece)Diff
    firebase-compat.js809 kB809 kB-7 B (-0.0%)
    firebase-firestore-compat.js348 kB348 kB-7 B (-0.0%)
    firebase-firestore-lite.js138 kB138 kB-7 B (-0.0%)
    firebase-firestore.js454 kB454 kB-7 B (-0.0%)

Test Logs

  1. https://storage.googleapis.com/firebase-sdk-metric-reports/kh6HrVq917.html

@google-oss-bot
Copy link
Contributor

google-oss-bot commented Nov 17, 2025

Size Analysis Report 1

Affected Products

  • @firebase/firestore

    • addDoc

      Size

      TypeBase (d1d898f)Merge (291aece)Diff
      size140 kB140 kB-7 B (-0.0%)
      size-with-ext-deps211 kB211 kB-7 B (-0.0%)
    • doc

      Size

      TypeBase (d1d898f)Merge (291aece)Diff
      size34.0 kB34.0 kB-7 B (-0.0%)
      size-with-ext-deps103 kB103 kB-7 B (-0.0%)

Test Logs

  1. https://storage.googleapis.com/firebase-sdk-metric-reports/YHNt9HzaTj.html

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.

Incorrect FirebaseError for malformed doc() invocation

3 participants