Skip to content

Conversation

@joehan
Copy link
Contributor

@joehan joehan commented Jul 30, 2025

Description

Fixes an edge case where, on Firebase Studio, the MCP server would tell you to run 'firebase login' but 'firebase login' would tell you that you are already logged in and short circuit.

Copy link
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.

Summary of Changes

Hello @joehan, 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 specific edge case in the firebase login command that caused issues in Firebase Studio. The core change ensures that the login process properly checks for the existence of a refresh token before declaring a user as 'already logged in', thereby resolving a frustrating loop where users were told to log in but then immediately told they were already authenticated. This improves the reliability and user experience of the login flow.

Highlights

  • Login Logic Fix: I've updated the login command to correctly identify when a user is truly logged in with a refresh token. Previously, the command would short-circuit and report 'Already logged in' even if only an access token was present, preventing the acquisition of a necessary refresh token, particularly in environments like Firebase Studio.
  • Typo Correction: I've corrected a minor grammatical error in the log message displayed after a successful login, changing 'preference' to 'preferences'.
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 in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.

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 issue 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 or fill out our survey to provide feedback.

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
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 addresses an edge case in the login flow by refining the condition that checks if a user is already logged in. The change correctly requires the presence of a refresh_token to consider a session active, preventing the command from short-circuiting incorrectly. My review includes a minor correction for a user-facing message that was part of the changes.

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
@joehan joehan enabled auto-merge (squash) July 30, 2025 17:52
@joehan joehan merged commit 9d86bf9 into master Jul 30, 2025
48 of 50 checks passed
@joehan joehan deleted the jh-login-refresh branch July 30, 2025 18:03
@github-project-automation github-project-automation bot moved this from Approved [PR] to Done in [Cloud] Extensions + Functions Jul 30, 2025
joehan added a commit that referenced this pull request Aug 5, 2025
* Fix apptesting enablement (#8905)

* Fix an issue with apptesting enablement

Co-authored-by: Joe Hanley <joehanley@google.com>

* Fix issue where login didnt work as expected on studio (#8914)

* Fix issue where login didnt work as expected on studio

* Update src/commands/login.ts

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>

---------

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>

* 14.11.2

* [firebase-release] Removed change log and reset repo after 14.11.2 release

* Enable FDC API in `firebase init dataconnect` for Spark projects (#8927)

* feat: address pr comments on app-* commands

* Fetch active Firebase Project from Studio Workspace when running in Studio (#8904)

* Disable broken VSCode integration tests (#8934)

* Add userinfo.email scope when in studio (#8935)

* Add userinfo.email scope when in studio

* Update src/requireAuth.ts

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>

* Update src/requireAuth.ts

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>

---------

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>

* feat: Display Firestore database edition (#8926)

* feat: Display Firestore database edition

Adds the 'Edition' to the output of the `firestore:databases:get` command.

The `Database` resource in the Firestore API now includes a `databaseEdition` field. This change updates the `DatabaseResp` type to include this new field and modifies the `prettyPrintDatabase` function to display the database edition in the output table.

The possible values for the edition are `STANDARD` and `ENTERPRISE`. If the edition is not specified or is `DATABASE_EDITION_UNSPECIFIED`, it will default to `STANDARD`.

* feat: Display Firestore database edition

Adds the 'Edition' to the output of the `firestore:databases:get` command.

The `Database` resource in the Firestore API now includes a `databaseEdition` field. This change updates the `DatabaseResp` type to include this new field and modifies the `prettyPrintDatabase` function to display the database edition in the output table.

The possible values for the edition are `STANDARD` and `ENTERPRISE`. If the edition is not specified or is `DATABASE_EDITION_UNSPECIFIED`, it will default to `STANDARD`.

* feat: Display Firestore database edition

Adds the 'Edition' to the output of the `firestore:databases:get` command.

The `Database` resource in the Firestore API now includes a `databaseEdition` field. This change updates the `DatabaseResp` type to include this new field and modifies the `prettyPrintDatabase` function to display the database edition in the output table.

The possible values for the edition are `STANDARD` and `ENTERPRISE`. If the edition is not specified or is `DATABASE_EDITION_UNSPECIFIED`, it will default to `STANDARD`.

Also refactors the tests for `prettyPrintDatabase` to improve readability and maintainability.

* feat: Display Firestore database edition

Adds the 'Edition' to the output of the `firestore:databases:get` command.

The `Database` resource in the Firestore API now includes a `databaseEdition` field. This change updates the `DatabaseResp` type to include this new field and modifies the `prettyPrintDatabase` function to display the database edition in the output table.

The possible values for the edition are `STANDARD` and `ENTERPRISE`. If the edition is not specified or is `DATABASE_EDITION_UNSPECIFIED`, it will default to `STANDARD`.

Also refactors the tests for `prettyPrintDatabase` to improve readability and maintainability and adds a test case for the `STANDARD` edition.

---------

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>

* Formatted

---------

Co-authored-by: Jake Ouellette <jakeout@google.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: Google Open Source Bot <firebase-oss-bot@google.com>
Co-authored-by: Fred Zhang <fredzqm@google.com>
Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
Co-authored-by: Sam Edson <samedson@google.com>
Co-authored-by: Ehsan <ehsann@google.com>
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