-
Notifications
You must be signed in to change notification settings - Fork 928
Get Docs currently hanging using pagination cursors #7669
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
Is there any resolution here.... |
I'm working on a reproduction. Thanks for your patience on this. |
Confirming I'm seeing the same behaviour on the v10 sdk. I can reliably recreate it by throttling the browser connection speed and calling getDocs with a "where ==" clause and an orderby. I'm seeing it in the initial request. It happens using the local emulator and cloud firestore. Edit - I've only tested this using NextJS 13 |
Is anyone reproducing this on a non-React app? I was testing today using v10, but without React, and I couldn't reproduce. |
Have begun to notice this will happen with initial request as well. |
Some more details now i've tested with a new project on a live database TLDR - Downgrading to sdk version 9.1.0. seems to fix the issue.Operating System Browser Version Firebase SDK Version Firebase SDK Product: Describe your project's tooling The QuerySnapshot returned by I've tested by setting up a new project with one page that runs getDocs on page load and logs the returned data, it's about as simple as I could make it. In both this test project and the more complex production app - downgrading to sdk version 9.1.0. seems to fix the issue. Currently everyone reporting this issue seems to be called Robert - unlikely that's related though. |
@RobertJewell, can you test with 10.2.x? There was a change made to the transport in 10.3, which could be affecting you. |
@MarkDuckworth im away from my machine for a few days so I won't be much help for a bit. Before I left I tested with 10.1.0 and that worked correctly. |
@MarkDuckworth any luck with a solution going forward on this? Do we still need someone to test 10.2.x and see if that's affected? |
@rob-yeshearing, I've had a few other higher priority items on my plate, but I'm freeing up from that to re-visit this. I have a hunch that this is related to a change in v10.3, but I haven't proven it. If you do have a chance to test with v10.2, that may give guidance to other readers. |
I built a test react app based on the code from @Rterrell25, however I'm still not able to reproduce the issue locally. We have had some other similar reported issues, #7652 and #7641. For #7652 I could only repro with the customer code and data, not with my own data. Could be the same case here. If anyone reporting in this thread can provide Firestore logs by setting |
@MarkDuckworth When I have a chance I will report the logs that are returned when setting the log level to debug in firestore. I will also test 10.2.x and see if the bug is still present in 10.2.x |
@MarkDuckworth here are the logs
I'm noticing similar to the other issues you've cited, [2023-10-20T13:59:19.910Z] @firebase/firestore: Firestore (10.4.0): WatchChangeAggregator Detected inactive target appears when the query fails to get more docs. |
@Rterrell25 and all, we released a fix for hanging queries so you can now use v10.5.2. Thanks for your help identifying this problem! |
@MarkDuckworth Thank you! |
Operating System
Mac OS Ventura 13.5.2
Browser Version
Google Chrome Version 117.0.5938.132
Firebase SDK Version
10.4.0
Firebase SDK Product:
Firestore
Describe your project's tooling
React app using Vite's react template, React version 18.2.0, Firebase web version 9 sdk version 10.4.0
Describe the problem
getDocs() currently hangs when trying to paginate data in firestore using the following query cursors startAfter, endAt, limit, and limitToLast. I am noticing the getDocs() queries will randomly hang and the promises never get resolved. The lastDoc and firstDoc references are always correct when running the queries, it just seems the getDocs() promises hang and never resolve at random. I am currently experiencing this heavily using emulators, but I can only assume this affects production as well.
Steps and code to reproduce issue
Set up a react app template using vite. The below code examples are being used to query a collection in firebase.
Initial fetch always works
Querying next page and previous page will randomly hang at the line where getDocs(q) is being called as I go to nextPage or previousPage.
Very hard to diagnose as the try catches do absolutely nothing in terms of error handling.
The text was updated successfully, but these errors were encountered: