-
Notifications
You must be signed in to change notification settings - Fork 119
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
Firestore futures don't complete on desktop #61
Comments
Just to sanity check, what are your database's security rules? edit: Actually based on the code running fine on iOS it's unlikely security rules are the issue here. |
The issue here is that the default dispatch queue for resolving futures is the the main queue on Apple platforms. The quickstart is running directly out of the main thread though so the main queue is never getting processed. On iOS running with A workaround for code in this scenario is to set a non main queue as the default callback queue using We have a change pending that will change the C++ SDK to always call back on non-main queues/threads to avoid this problem in the future. |
Okay. Thanks for the explanation. Our code is packaged as a pure C++ cross platform library which is then wrapped for iOS (and eventually Android) so the In practice any desktop code we write (e.g. internal admin tools using the said library) will not be susceptible to this - it was a quick test on desktop in a simple |
In tests, the way we've handled setting the dispatch queue is to have one .mm file in the project with a single Re
Eventually we'll have to come up with some cross-platform way to handle this, but I think changing the default to some other queue makes this not broken by default and handles all but the most demanding use cases. |
This seems to be related to the fix in 6.15.1. Does it still happen after you upgrade to 6.15.1? |
It still happens. My understanding about the fix in 6.15.1 is it's just the warnings about handle lifetimes when you shut down. |
The warning does not seems to have adverse effect. We still need to figure out how to get rid of it from our side. |
Fixed in 6.16.0 |
Please fill in the following fields:
Pre-built SDK from the website or open-source from this repo: website
Firebase C++ SDK version: 6.15.0
Firebase plugins in use (Auth, Database, etc.): Firestore, Auth
Additional SDKs you are using (Facebook, AdMob, etc.): N/A
Platform you are using the C++ SDK on (Mac, Windows, or Linux): Mac
Platform you are targeting (iOS, Android, and/or desktop): iOS and desktop (iOS is fine)
Please describe the issue here:
(Please list the full steps to reproduce the issue. Include device logs, Unity logs, and stack traces if available.)
Apply firebase/quickstart-cpp#47 so that the firestore quickstart will compile. Compile and run. The logs have a lot of
ERROR: <something> returned an invalid result
which looking at the code is the error printed when the timeout elapses.Full output from the quickstart:
In my own project code I have:
as part of fairly extensive use of Firestore. It all runs fine on iOS but the lambda is never called on desktop.
Please answer the following, if applicable:
Have you been able to reproduce this issue with just the Firebase C++ quickstarts ?
Yes, after updating the quickstart so that it compiles with 6.15.0 (see firebase/quickstart-cpp#47)
What's the issue repro rate? (eg 100%, 1/5 etc)
100% on desktop.
The text was updated successfully, but these errors were encountered: