chore(fdc): Use service classes to fetch auth and appcheck instances#18263
chore(fdc): Use service classes to fetch auth and appcheck instances#18263aashishpatil-g merged 4 commits intomainfrom
Conversation
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 deprecates the explicit passing of FirebaseAuth and FirebaseAppCheck instances in the FirebaseDataConnect constructor and instanceFor method, transitioning to automatic internal handling via the FirebaseApp service registry. It also includes updated mocks and new tests to verify dynamic service discovery. Feedback was provided to update the class fields directly during transport initialization to ensure state consistency instead of relying on local variables.
| auth ??= app.getService<FirebaseAuth>(); | ||
| appCheck ??= app.getService<FirebaseAppCheck>(); |
There was a problem hiding this comment.
This is a bit of changing the behavior. The previous is if auth and appcheck is not passed in, instantiate one and put that. The changed code will be, if auth and appCheck is not passed in, assign it with an already registered auth/appcheck instance. If they are not instantiated, it will still keep null.
But also the previous behavior doesn't config auth and appcheck after instantiated. What is the expected thing here?
There was a problem hiding this comment.
Reverted to the previous behavior.
Use service resolvers to get auth and app check parameters.