Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
[Firestore] whereArrayContains not working in offline scenario. #155
[REQUIRED] Step 2: Describe your environment
[REQUIRED] Step 3: Describe the problem
Add a string value to document's array by
Steps to reproduce:
Let's say we have a collection
Step to reproduce:
In the beging the log shows:
The listener at step 1 now shows log:
The result are the same:
But I expect the result size be 1 because document "todo1" should be included.
The same steps work well when device online, both query shows size 1 with
Any reply were be appreciated, thanks.
It will happen when you do an update() that causes a document that used to not-match the query to now match the query. Basically, since the original document didn't match the query, we fail to apply the update(), and so it doesn't get considered in the final query results. :-/ As a workaround you could potentially use a
We'll take a look at getting this fixed in an upcoming release. Thanks again for reporting it.
@var-const I wonder if this is something you might be able to look at tackling?
I went to try to fix it on web (so I could write a spec test for validation), but realized I wanted the
Here's the spec test I wrote (with the intention of adding it to listen_spec.test.ts after the "Ensure correct query results with latency-compensated deletes" test:
NOTE: I verified it fails in the way I expect, but since I haven't fixed the bug can't 100% guarantee it's correct. :-)
Alternatively, I can look at tackling this once you've ported your perf improvements to web. Thanks.