-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
🐛 [cloud_firestore] Still ServerTimestampBehavior crashes #10715
Comments
Hi @tecbot, can you provide a minimal sample? Can you also check if it reproduces on the latest version of |
@danagbemava-nc I can't create a minimal sample because this error happen only in production and only for a rare amount of users. There are no relevant code changes between 4.4.5 and 4.5.0 which could fix this issue, therefore im sure this issue still exists in 4.5.0. Are those 3 stack traces not helpful? |
Hey @Lyokone. No we don't use this feature. We have upgraded from version 4.2.0 to 4.4.5 and the crashes started to occur. We have some background plugins but none of them accessing firestore. Regarding the fix in #10728 we could try this out. Approx. I can give you an answer in ~7 days after we have slowed rolled out to customers. However I think the fix also needs to be included in the FIRQuerySnapshot method. Because 1. Stacktrace happen on line 199 |
I've added a fix for line 199 as well. If it solves crashes on your end, I'll merge that. I suspect some kind of race conditions between 2 serialisations. I wasn't able to reproduce it with concurrent reads. |
We encountered the same problem with intermittent users in production and noticed a similar log file. The issue is happening on a specific screen that was running a query snapshot. |
@Lyokone, I encountered the same problem and modified it according to @Lyokone's method, but it still crashed. The Log: Crashed: dev.flutter.firebase.firestore |
@Lyokone, after doing some trial-and-error, we were able to stop the crashes by setting firestore persistent storage = false and set snapshot includeMetadataChanges = false.... hope this gets fixed so we can take advantage of reading offline data |
Thanks for your research, it will help to find the origin of the issue. |
hey @Lyokone ... any luck on finding the bug? looking forward to use offline mode again.. :) |
Good to know, thanks for letting me know; it was in my backlog for this week. It's probably why it was hard to reproduce, I'll see to add some tests around this 👍 |
hey @Lyokone, with the latest version of Flutter and Firestore, we have this error but for now can only replicate the error on iPhone 12 with offline mode enabled.. iPhone 14 and others were ok. |
Same issue?? This is log.
Package version.
Occurs in the production environment. But also occurs in simulator. |
When will this be fixed? I'm in a lot of trouble. |
We have also seen crashes related to this. Looking at the code, the implementation of In Objective C you need to consider multi-threading. Neither properties of objects nor structures such as Updates to the dictionary itself need to be protected via some form of exclusive access mechanism such as a semaphore. |
use dispatch_once to instantiate `serverTimestampMap` Fix firebase#10715
Use thread-safe `NSCache` instead of `NSMutableDictionary` Do not bypass getter Consistently use static property USe `dispatch_once` to ensure single instantiation of cache.
From our internal monitoring this issue has been resolved by #11501 |
Hey @tecbot. We need more information to resolve this issue but there hasn't been an update in 7 weekdays. I'm marking the issue as stale and if there are no new updates in the next 7 days I will close it automatically. If you have more information that will help us get to the bottom of this, just add a comment! |
Closing out as I believe this issue has been resolved with this fix #11501 |
Bug report
Describe the bug
Still crashes related to ServerTimestampBehavior after bug fix #10391 and #10314
cloud_firestore: 4.4.5
The text was updated successfully, but these errors were encountered: