Repository navigation
fix(firebase_database_web): point DataSnapshot.child() ref at the child - #18822
Conversation
`DataSnapshot.child(path)` reused the parent reference, so
`snapshot.child('a').ref.set(x)` overwrote the parent on web. The child
snapshot now uses `ref.child(path)`, as `children` already did.
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. |
Description
DataSnapshotWeb.child(path)passed the parentrefto the child snapshot. On web,snapshot.child('a').refpointed at the parent, sosnapshot.child('a').ref.set(x)overwrote the parent. The child snapshot now usesref.child(path), likechildrenalready does. Native platforms are not affected.Testing
firebase_database_web/test/data_snapshot_web_test.dart(new, Chrome), using a stand-in for the JSDataSnapshot. Fails onmain(Expected: 'messages/a',Actual: 'messages').melos run test:webpicks it up.dart analyze --fatal-infosis clean.Related Issues
Checklist
///).melos run analyze) does not report any problems on my PR.Breaking Change