Repository navigation
Conversation
…erop code Fixes a runtime TypeError in firebase_performance_web's Trace.getAttributes() where dartify() on JS objects was incorrectly cast to Map<String, String> instead of Map<Object?, Object?>. Also removes unused and broken dartify() casting helpers in firebase_auth_web and firebase_remote_config_web.
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 removes the toJson method from the web User class, removes the defaultConfig getter from RemoteConfig, and refactors Trace.getAttributes to handle null or empty attributes more safely, accompanied by new unit tests. Regarding the feedback, using as Map? on the result of dartify() in Trace.getAttributes could still lead to a runtime TypeError if the returned value is not a map; it is recommended to use flow analysis with is Map instead to ensure type safety.
On both JS and
dart2wasm,JSAny?.dartify()allocates<Object?, Object?>{}for JS objects, so directas Map<String, T>casts throwTypeErrorat runtime. This PR fixes and adds browser unit tests forTrace.getAttributes()infirebase_performance_web,RemoteConfig.defaultConfiginfirebase_remote_config_web, andUser.toJson()infirebase_auth_web.Verified locally under
flutter test --platform=chromeandflutter test --platform=chrome --wasm.Checklist
///).melos run analyze) does not report any problems on my PR.Breaking Change
Does your PR require plugin users to manually update their apps to accommodate your change?