-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Firestore Crash - Mutation batchIDs must be acknowledged in order #772
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
We're tracking this as b/73293239 internally and are looking into this. |
This fix is now published in Firebase 4.10.0. |
I just updated to the latest Firebase SDK 4.10.0 and unfortunately I'm still getting the crash. Could this issue be reopened please?
|
Just to add a bit more info, the crash happens here:
|
Reopening issue. Would it be possible to capture logs of the issue by adding |
Thanks for reopening.
Does this help or do you need more of the logs? |
More of the logs would be helpful, especially around where |
No problem, I've added all logs between calling
Between the above and the actual crash, there's about 2000 lines of logs (mostly due to all the active listeners going back online and a few writes being executed). |
Thanks @SL62. I think we still need more of the logs. Everything in that last snippet looks as-expected. To ensure we understand what's going on, I'd really like /all/ of the Firestore logs leading up to the crash (both before and after the snippet you pasted). I suspect that we're somehow re-sending a write we shouldn't be or else skipping a write. To verify this I'll need to see the preceding writes and their results. If the logs are too long you could put them in a gist. Or if they contain sensitive data but you're willing to share privately, you can email them to me at [email protected]. Without logs, we'll probably need a concrete way for us to reproduce the error so that we can investigate what's going on. Thanks and sorry for the inconvenience! |
No problem, I've sent you an email with the full log as it does contain sensitive data. |
getNextMutationBatchAfterBatchId() was not respecting highestAcknowledgedBatchId and therefore we were resending writes after the network was disabled / re-enabled as reported here: firebase/firebase-ios-sdk#772
Hi @SL62 we released Firebase 4.10.1 which addresses the memory corruption issue which was the root cause of the bug you were seeing. Let us know how it goes. Thanks for your patience! |
Whoops. 4.10.1 fixes the secondary issue you emailed about, but we need an additional change to actually address the root cause of this issue. |
Port of: firebase/firebase-js-sdk#559 Fixes #772 getNextMutationBatchAfterBatchId() was not respecting highestAcknowledgedBatchId and therefore we were resending writes after the network was disabled / re-enabled.
Port of: firebase/firebase-js-sdk#559 Fixes #772 getNextMutationBatchAfterBatchId() was not respecting highestAcknowledgedBatchId and therefore we were resending writes after the network was disabled / re-enabled.
Port of: firebase/firebase-js-sdk#559 Fixes #772 getNextMutationBatchAfterBatchId() was not respecting highestAcknowledgedBatchId and therefore we were resending writes after the network was disabled / re-enabled.
…559) getNextMutationBatchAfterBatchId() was not respecting highestAcknowledgedBatchId and therefore we were resending writes if they had been acknowledged but not removed (aka the held write acks case). This showed up when a user disabled / enabled the network as reported here and I've included a spec test to emulate that case: firebase/firebase-ios-sdk#772
…909) Port of: firebase/firebase-js-sdk#559 Should address #772 once released. getNextMutationBatchAfterBatchId() was not respecting highestAcknowledgedBatchId and therefore we were resending writes after the network was disabled / re-enabled.
Fixed in Firebase 4.11.0 FirebaseFirestore 0.10.4 |
…irebase#909) Port of: firebase/firebase-js-sdk#559 Should address firebase#772 once released. getNextMutationBatchAfterBatchId() was not respecting highestAcknowledgedBatchId and therefore we were resending writes after the network was disabled / re-enabled.
[REQUIRED] Step 2: Describe your environment
[REQUIRED] Step 3: Describe the problem
Assertion failure in -[FSTLevelDBMutationQueue acknowledgeBatch:streamToken:group:], third_party/firebase/ios/Source/Firestore/Source/Local/FSTLevelDBMutationQueue.mm:235
Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'FIRESTORE INTERNAL ASSERTION FAILED: Mutation batchIDs must be acknowledged in order'
Steps to reproduce:
Using the new disableNetwork() and enableNetwork() methods under certain scenarios causes the app to crash.
Yet to determine the exact scenarios, but it seems to occur when calling disableNetwork() when the app is in the middle of reading data from the web or writing data.
Moving the disableNetwork() method to an earlier part of the code appears to eliminate / reduce the frequency of crashes.
Logs:
The text was updated successfully, but these errors were encountered: