-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
[bug] The XHR server breaks code that relies on multiple readyStateChanges with the same readyState (3) #1150
Comments
I'm having the same issue. I thought something was wrong with my code, but it worked after I increased the timeout to 60 seconds. Outside the test runner page loads in ~1.5 seconds. |
@tugceakin could you validate if PR #1195 solves your issue? |
@meDavid I am having this issue as well. Is it solved in a new version of Cypress - or where do I find this file after installing with NPM? |
I'm still seeing this in 3.1.0. Hoping to get this resolved! |
That would be great if somebody could fix it. May be @brian-mann or @chrisbreiding could allocate some time to it. I think we could even do something like BugBounty reward or something similar to speed it up (I'm new to it). Our team can't use Cypress with Firestore because of it :( |
To reproduce, I have an example app/spec which will hit Firestore. |
Symptoms
I tried to make a Cypress test on a Firebase Firestore project, but it would take around 30sec to load the data inside the test runner, while outside the testrunner it would load instant. After some investigation I found out this was due to some kind of long-poll system they use to retrieve the data streams from the server. When I disabled the the XHR server inside the cypress_runner.js the issue was no longer observed.
The XHR server overrides the onreadystatechange listener and will only invoke the original listener if it hasn't already seen the readyState. But having the readyState 3 (loading) multiple times, each time with the additional responseText is perfectly legal and relied upon in the Firebase SDK for Firestore.
The specific line of code that needs to be removed or allow for multiple readystate 3 calls:
cypress/packages/driver/src/cypress/server.coffee
Line 412 in 2b2b6d9
I don't have a limited example right now, but my guess is that any Firestore project will work.
The text was updated successfully, but these errors were encountered: