[cloud_firestore] Incorrect DocumentReference == equals behavior on the same path on default firestore instance #2081
Labels
impact: customer
A bug with low impact (e.g. affecting only a few customers or has a workaround). (P3)
plugin: cloud_firestore
type: bug
Something isn't working
Describe the bug
When doing an equals on two document references:
When diving into the issue a bit, I found the source code for DocumentReference
==
checks the path and the firestore instance.The path is equal, so when I looked at the two firestore instances, even though they're both from the same default app, (only one firebase app in my project), they're not equal.
I didn't get a chance to dive deeper into why the above equals check doesn't work, but upon inspecting the firestore instances, I saw the default firebase app doesn't have the same hashcode across the two firestore instances 🤔
That might be a helpful tip. Maybe look into the equals for firestore / firebase? Maybe always kick back true if both firestore instances are from the default app?
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Document references with the same path from the same default firestore instance should be equal.
Additional context
This may or may not be also messing up usage of
DocumentReference
s as a viable key in a map - lookups to maps with theDocumentReference
as it's key randomly doesn't work, which may or may not be due to this issue.The text was updated successfully, but these errors were encountered: