-
Notifications
You must be signed in to change notification settings - Fork 932
Requesting data with source: server
does not actually go to server and returns data from cache
#7848
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
Hi @jbalidiong , thanks for reporting. You seem to be using a very old SDK version (8.3.2 is at least 2 major versions behind). The newest version is 10.7.1. Please upgrade to the newest version. Unfortunately we won't look into issues related to version 8, as it's been deprecated now. If you continue to see the issue in the latest version, please let me know along with a way to reproduce the issue. |
Hey @andreymikhadyuk. We need more information to resolve this issue but there hasn't been an update in 5 weekdays. I'm marking the issue as stale and if there are no new updates in the next 5 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! |
@ehsannas Thanks for the info, I've updated the version and we will check whether the issue is still there or not. |
After updating the version to latest one we still had fully the same issue. We decided to clear the cache and see whether the issue will return or not with the latest version. If yes, then I will come back to this issue. |
@ehsannas Hello!
Here is the snapshot screen (you can see that I do not really have steps to reproduce, it is such a rare thing, but we cannot fix it. The only way is to clear the cache in the browser. |
Any Updates on this? Dealing with the same problem. |
@ehsannas Hey👋🏻 Any thoughts on this? |
hi folks, can anyone provide a minimal code to reproduce this? |
From my side this is just a rare thing which appears after some time of using our app. |
Any updates? Same exact issue in my app. Only every once in a while and specifically in chrome Version 123.0.6312.107 (Official Build) (x86_64). |
Drive-by comment: If anyone is able to reproduce this bug, please enable Firestore debug logging by calling |
Can confirm I am experiencing the same exact issue. Its been plaguing my firebase project for almost a year now and I only now have been have to locate the issue due it being such a rare and difficult bug to locate. Currently on Firebase ^10.8.1 I haven't tried Firestore debug logging yet but I will attempt that tomorrow and report back if I find anything. Here are the bullet points of what I found so far.
Temporary Solution: This isn't a great solution but it can fix the issue if you are able to detect it occurred. Basically just delete IndexedDB and reload the page so it does a fresh reload of firestore and its local cached database.
|
Okay here are my Firestore debug logs. Hopefully its helpful, I apologize if they are lengthy, but there does appear to be some important happenings in them, specifically the problematic document in question (users/i8AVk3h2EcdBt2SC9fXmimOE89A2) appears to be getting deleted in the 2nd to last screenshot. |
For anyone experiencing this issue, please upgrade to v10.12.1 (released May 20, 2024) and try again. A fix went into this version (#8247) for a bug where flaky/empty snapshots were being raised when multi-tab persistence was enabled. I have high confidence that the problems reported in this issue will be fixed in that version. |
Hey @andreymikhadyuk. We need more information to resolve this issue but there hasn't been an update in 5 weekdays. I'm marking the issue as stale and if there are no new updates in the next 5 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! |
Since there haven't been any recent updates here, I am going to close this issue. @andreymikhadyuk if you're still experiencing this problem and want to continue the discussion just leave a comment here and we are happy to re-open this. |
Operating System
Windows 11 Pro 22H2
Browser Version
Firefox v120.0.1 (64-bit)
Firebase SDK Version
^8.3.2
Firebase SDK Product:
Firestore
Describe your project's tooling
It is web app written using React
v17.0.1
. For state management we use redux (with sagas).Describe the problem
We've enabled persistence in our app. In some places we rely on the cached data. So sometimes we do request using
source: cache
and if there is no data in cache we try same request usingsource: server
.We display a list of items and for each item we fetch its
discussion
. The issue is that for one of our teammates somehow after some time of app usage some discussions become empty in the cache, but even doing a request withsource: server
does not really go to server, we still get empty data in the response (and yes, by the query we have data in the db). In another browser or after clearing the cache the issue is solved. Changing cache size to unlimited did not solve the problem.Me and my teammate tried to intentionally reproduce the issue by doing following:
source: server
did not throw an error. The code continued working in thetry
block and in the logs we could seenull
data havingfromCache=false
.So we could not reproduce the issue. But my teammate has this issue in our dev and prod environments in his Firefox.
Steps and code to reproduce issue
As I mentioned in the problem description, we could not intentionally reproduce it.
Here is the code example of how we fetch that data:
We tried to remove the logic of fetching with
source: cache
by using justsource: server
to get data directly from server, but we still get empty data havingfromCache=false
. As I mentioned in the problem description, going offline does not throw the error during the request, the code keeps executing in thetry
block with empty data in thesnapshot.data()
.The text was updated successfully, but these errors were encountered: