Comments (5)
@IvanBean Thanks for reporting this! I've reproduced the issue and tracked it down to a bug in our local query processing here.
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 set()
or set(..., SetOptions.merge())
instead of the update.
We'll take a look at getting this fixed in an upcoming release. Thanks again for reporting it.
from firebase-android-sdk.
Michael, I think I can do it together with the porting.
from firebase-android-sdk.
@IvanBean thanks for the specific reproduction steps! Sounds like a bug to me, will wait for @gsoltis or @wilhuff to chime in.
from firebase-android-sdk.
Hrm. That certainly doesn't sound expected. I'll try to reproduce.
from firebase-android-sdk.
@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 RemoteDocumentCache.getAll()
method that you recently added (but hasn't been ported to web yet). And if I do fix it on web, it may conflict with your porting of that work.
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:
specTest(
'Ensure correct query results for latency-compensated updates',
[],
() => {
const fullQuery = Query.atPath(path('collection'));
const filteredQuery = fullQuery.addFilter(filter("match", "==", true));
const docA = doc('collection/a', 1000, { match: false });
const docAv2Local = doc('collection/a', 1000, { match: true }, { hasLocalMutations: true });
return (
spec()
.userListens(fullQuery)
.watchAcksFull(fullQuery, 1000, docA)
.expectEvents(fullQuery, { added: [docA] })
// patch docA so that it will now match the filtered query.
.userPatches("collection/a", {match: true })
.expectEvents(fullQuery, { modified: [docAv2Local], hasPendingWrites: true })
// Make sure docA shows up in filtered query.
.userListens(filteredQuery)
.expectEvents(filteredQuery, { added: [docAv2Local], fromCache: true,
hasPendingWrites: true })
);
}
);
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.
from firebase-android-sdk.
Related Issues (20)
- firebase messaging registration using recent versions of the sdk (2021 and beyond) does not work on android 7 HOT 4
- Firebase Storage `ref.delete()` is emitting exception HOT 4
- Images getting corrupted on upload to bucket HOT 3
- Firestore Uncaught exception in the SynchronizationContext. Panic! HOT 4
- Could not get Response payload size data from firebase perfomance monitoring HOT 6
- Analytics - duplicated events in Debug View / Debug build HOT 8
- AGP 8.3.2: java.lang.RuntimeException: Unable to get provider com.google.firebase.provider.FirebaseInitProvider: java.lang.IllegalStateException: The Crashlytics build ID is missing. HOT 4
- onNewToken() returns the wrong token HOT 6
- [FR]: Make Firebase Screen ID Parameter Editable HOT 1
- OOM error HOT 2
- ANR triggered by slow IO operations [com.google.firebase.iid.Store.checkForRestore] HOT 4
- "java.lang.IllegalArgumentException: Service not registered" when unbinding in SessionLifecycleServiceBinderImpl HOT 1
- FirebaseDatabase.GoOnline does not work when connecting to a Firebase Emulator on Android Emulators HOT 1
- Firebase OTP - The SMS code has expired. HOT 1
- Storage barfs AppCheck warnings into logcat when AppCheck is not enabled HOT 1
- 崩溃问题详情 com.google.firebase.FirebaseApp.getInstance java.lang.IllegalStateException HOT 6
- Firebase Realtime Remote Config Connection is Causing ANR during Background Launch HOT 4
- Enhancing Crashlytics Reporting: Timely Delivery of Non-Fatal Reports HOT 1
- java.lang.AssertionError: hardAssert failed: listen() called twice for same QuerySpec. HOT 5
- Remote Config - FirebaseRemoteConfigFetchThrottledException but interval is not short HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from firebase-android-sdk.