dataconnect(feature): AuthUserChangedException added - #8604
Conversation
This replace the internal FirebaseUserChangedException with public AuthUserChangedException to enable reliably detecting when a realtime streaming connection fails due to a change in the Firebase Auth user. TAG=agy CONV=a7a30ca1-060f-4738-b204-3fb32afda5d6
…ngedException TAG=agy CONV=a7a30ca1-060f-4738-b204-3fb32afda5d6
…is is a semantic change
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 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 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. |
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces the public AuthUserChangedException class to replace the internal FirebaseUserChangedException, enabling clients to reliably detect when a realtime streaming connection fails due to a change in the Firebase Auth user. Corresponding updates have been made to the public API, tests, and core connection logic, along with a major version bump to 18.0.0. The feedback suggests removing the open modifier from AuthUserChangedException to make it final, as there is no current need for subclassing.
📝 PRs merging into main branchOur 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. |
This PR augments the Data Connect public API with a deterministic way for applications to identify "user change" errors during realtime streaming query subscriptions. It replaces the internal
FirebaseUserChangedExceptionwith a new public exception,AuthUserChangedException. This allows developers using the Android SDK to reliably and safely implement automatic re-subscription when the Firebase Auth user signs in or out, rather than relying on fragile exception message scraping.Googlers see go/data-connect-firebase-user-changed-exception-api-proposal
Highlights
AuthUserChangedExceptionas a subclass ofDataConnectExceptionfor explicitly bubbling up errors caused by a Firebase Auth user change mid-stream.FirebaseUserChangedExceptionin GRPC streaming logic withAuthUserChangedException.gradle.propertiessince this introduces a semantic breaking change to error handling logic.AuthUserChangedExceptioninstead of the internal exception when auth states change.Changelog
AuthUserChangedExceptionas a semantic change.AuthUserChangedException.AuthUserChangedExceptionalong with detailed KDoc comments.AuthUserChangedExceptioncode.FirebaseUserChangedExceptionwithAuthUserChangedExceptionand removed the old internal exception class.AuthUserChangedExceptionis emitted when the auth UID changes mid-stream or during reconnection.