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:
|
return if readyStates[@readyState] |
I don't have a limited example right now, but my guess is that any Firestore project will work.
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.