[help wanted] Firestore will not return a response after a long time since you started using it.
See original GitHub issueOverview (Required)
- We can not use favorite!! š
- I can fix it clear app data. So probably, app internal problem.
- I canāt fix this by force stop app.
- It occurred release and debug
- If it occurred, FavoriteFirestoreDatabase āFirestore:setupFavoritesDocumentā is logged, But āFirestore:setupFavoritesDocument onCompleteā is not logged.
@CheckResult
private fun setupFavoritesDocument(currentUser: FirebaseUser): Single<FirebaseUser> {
return Single.create({ e: SingleEmitter<FirebaseUser> ->
if (DEBUG) Timber.d("Firestore:setupFavoritesDocument")
val database = FirebaseFirestore.getInstance()
val favorites = database.collection("users/" + currentUser.uid + "/favorites")
favorites.get().addOnCompleteListener { task ->
if (DEBUG) Timber.d("Firestore:setupFavoritesDocument onComplete")
Issue Analytics
- State:
- Created 6 years ago
- Comments:11 (11 by maintainers)
Top Results From Across the Web
Best practices for Cloud Firestore - Firebase
If you are not querying based on a large array or map field, you should exempt it from indexing. Read and write operations....
Read more >āWhy is my Cloud Firestore query slow?ā | Firebase Developers
The best way to fix this issue is to make sure you're not transferring down more data than you need. One simple option...
Read more >Getting data | Firestore - Google Cloud
There are three ways to retrieve data stored in Firestore. Any of these methods can be used with documents, collections of documents, or...
Read more >firebase - Firestore - How to get document id after adding a ...
Yes it is possible. When you call the .add method on a collection, a DocumentReference object is returned. DocumentReference has the idĀ ...
Read more >Cloud Firestore - React Native Firebase
If you have started to receive a app:mergeDexDebug error after adding Cloud Firestore, please read the Enabling Multidex documentation for more information onĀ ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hello š First comment on this project!
I think itās a problem about Firestoreās behavior when device is regarded as offline.
The official document of Firestore says:
https://firebase.google.com/docs/firestore/manage-data/enable-offline#get_offline_data
So, if the document is empty,
favorites.get()
cause error and return nothing. We should usefavorites.addSnapshotListener(...)
instead.I tried code above, and it seems to work well. If Itās OK, I create PR! š
I did reproduce this issue may be. In my case, same behaviour occurs when launch app without network connection.
I tried to repeat step 4 to 6 after turned on wifi, it still same result. But after about 1 minutes, it revived suddenly. However, I can not see any log in setupFavoritesDocument()