fix(firestore): log a warning when databaseId is not found#9472
fix(firestore): log a warning when databaseId is not found#9472
databaseId is not found#9472Conversation
🦋 Changeset detectedLatest commit: 4ad0d67 The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
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 |
Summary of ChangesHello @dlarocque, 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 introduces a targeted logging improvement within the Firestore client's web channel connection logic. By adding a warning message for 'NOT_FOUND' errors, the change aims to enhance diagnostic capabilities, making it easier to identify and resolve issues related to missing Highlights
🧠 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 AssistThe 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
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 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
|
There was a problem hiding this comment.
Code Review
This pull request adds a warning log for when a 'NOT_FOUND' status is received from the backend. While this is a good addition for diagnostics, the current log message is too generic. I've provided a suggestion to make the log message more specific and helpful by including the database ID, which will make it easier for developers to debug configuration issues.
packages/firestore/src/platform/browser/webchannel_connection.ts
Outdated
Show resolved
Hide resolved
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request adds a helpful warning when a specified Firestore database is not found, which improves the developer experience by providing a clear message for a common configuration error. My review includes a suggestion to make the error message detection more robust against potential changes in the backend's error message format.
packages/firestore/src/platform/browser/webchannel_connection.ts
Outdated
Show resolved
Hide resolved
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
When a non-existent databaseId is passed to getFirestore, the SDK fails silently. The WebChannel connection yields no HTTP errors, the SDK throws no exceptions, and nothing is logged. The client eventually falls into offline mode after 10 seconds.
This PR improves DX by intercepting the
NOT_FOUNDerror in the WebChannel connection. If the error message confirms the database itself is missing, we now log a warning to the console.Note: The detection logic relies on matching the specific string: "The database ... does not exist". This is brittle; if the backend error message changes, this warning will stop appearing. Currently, the backend returns a generic NOT_FOUND status for both missing documents and missing databases. String matching is the only way to distinguish the two scenarios on the client side without backend changes.