Skip to content
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

Handle long-polling requests #124

Open
girigirianish opened this issue Mar 26, 2021 · 5 comments
Open

Handle long-polling requests #124

girigirianish opened this issue Mar 26, 2021 · 5 comments

Comments

@girigirianish
Copy link

I'm using Firestore in my project. Firestore seems to use long-polling on HTTP GET requests to provide its real-time updates. This means firestore js library (i'm using angularfire2) first makes a POST request to firestore servers. That one is fine. Then it does a GET request, which is kept open for a long time, around a minute. If you look at that GET request in Chrome's devtool, it will show you an empty response because devtools are waiting for the request to close I guess to display the response.

At this point, the GET request is intercepted by xhook, but xhook is not logging (log that I kept in after hook) it cause the request is still not closed.

After 10s, firebase call-site which is wrapped by xhook fails to get the data they want, so they print this:

index.esm.js:117 [2019-07-26T05:13:21.884Z] @firebase/firestore: Firestore (6.3.1): Could not reach Cloud Firestore backend. Backend didn't respond within 10 seconds.
This typically indicates that your device does not have a healthy Internet connection at the moment. The client will operate in offline mode until it is able to successfully connect to the backend.

We are looking forward for the fix or any workaround.

Thanks in advance

@girigirianish
Copy link
Author

@jpillora @morsdyce
Any hint on this would be very helpful :).

@girigirianish
Copy link
Author

@jpillora any chance I can get any hint on this?

@jpillora
Copy link
Owner

jpillora commented Apr 9, 2021 via email

@girigirianish
Copy link
Author

girigirianish commented Apr 9, 2021

@jpillora Thank you very much for your reply. So any fix in the pipeline for this issue? Trying to debug it for a long but could not figure it out. And this has been a blocker for us.

Debugging findings:

When the long polling request is intercepted. The xhr ready state will take some time to resolve and the state remains on state 3 and the control is not being forwarded to the current interception and firebase times out with this.

Eagerly awaiting your feedback on this.

Please let me know I could wire up a reproducible public repo with this issue.

It would be a very great help for me if I could get insights from you

Thanks

@jpillora
Copy link
Owner

jpillora commented Apr 9, 2021 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants