Closed nazim-baya closed 3 weeks ago
I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.
Hi @nazim-baya . I see the following in the log:
(25.0.0) [WatchStream]: (df00582) Stream closed with status: Status{code=PERMISSION_DENIED, description=The project was disabled or deleted., cause=null}.
This suggests that the server sent a PERMISSION_DENIED error to the client before the device went offline. This might be because authentication was not successful, or your Firestore Security Rules blocked the request. As a result, it is unlikely that the local cache will contain anything for when you're offline.
addOnFailureListener
hi
Hi @nazim-baya . I see the following in the log:
(25.0.0) [WatchStream]: (df00582) Stream closed with status: Status{code=PERMISSION_DENIED, description=The project was disabled or deleted., cause=null}.
This suggests that the server sent a PERMISSION_DENIED error to the client before the device went offline. This might be because authentication was not successful, or your Firestore Security Rules blocked the request. As a result, it is unlikely that the local cache will contain anything for when you're offline.
hi, if we do not add addOnFailureListener
, will it cause the client app to crash?
Because that's what Im experiencing currently
Yes. If you are offline and try to get a document, if the client is not able to reach the server, it will try to return a document from the cache, and if the document does not exist in the cache either, the SDK will return a Task that has an exception upon completion to indicate the error.
[READ] Step 1: Are you in the right place?
Issues filed here should be about bugs in the code in this repository. If you have a general question, need help debugging, or fall into some other category use one of these other channels:
[REQUIRED] Step 2: Describe your environment
[REQUIRED] Step 3: Describe the problem
Steps to reproduce:
Just trying to retrieve Firestore data when the user is authenticated and got an offline error Failed to get document because the client is offline.
Relevant Code:
Code to retrieve objects in the database :
Gradle file :