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

[bug] The XHR server breaks code that relies on multiple readyStateChanges with the same readyState (3) #1150

Closed
meDavid opened this issue Jan 5, 2018 · 6 comments
Assignees
Milestone

Comments

@meDavid
Copy link
Contributor

meDavid commented Jan 5, 2018

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.

@meDavid meDavid changed the title [bug] The XHR server breaks code that relies on multiple readyStateChanges with the same readState (3) [bug] The XHR server breaks code that relies on multiple readyStateChanges with the same readyState (3) Jan 5, 2018
@jennifer-shehane jennifer-shehane added the stage: ready for work The issue is reproducible and in scope label Jan 5, 2018
@tugceakin
Copy link

tugceakin commented Feb 11, 2018

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.

@meDavid
Copy link
Contributor Author

meDavid commented Feb 13, 2018

@tugceakin could you validate if PR #1195 solves your issue?

@alexbjorlig
Copy link

@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?

@jennifer-shehane jennifer-shehane added stage: pending release and removed stage: ready for work The issue is reproducible and in scope labels Mar 27, 2018
@jennifer-shehane jennifer-shehane added this to the 2.2.0 milestone Mar 27, 2018
@jennifer-shehane jennifer-shehane modified the milestones: 2.2.0, 3.0.0 Apr 11, 2018
@jennifer-shehane jennifer-shehane added stage: needs review The PR code is done & tested, needs review and removed stage: pending release labels May 17, 2018
@brian-mann brian-mann modified the milestones: 3.0.0, 3.1.0 May 31, 2018
@brian-mann brian-mann removed this from the 3.1.0 milestone Aug 6, 2018
@BirdInTheCity
Copy link

I'm still seeing this in 3.1.0. Hoping to get this resolved!

@spy4x
Copy link

spy4x commented Aug 31, 2018

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 :(

@bdiz
Copy link

bdiz commented Sep 1, 2018

To reproduce, I have an example app/spec which will hit Firestore.
Steps to run the app are on the bug I filed #2374.

@jennifer-shehane jennifer-shehane added this to the Sprint 3 milestone Sep 17, 2018
@lilaconlee lilaconlee modified the milestones: Sprint 3, Sprint 4 Oct 1, 2018
@lilaconlee lilaconlee removed their assignment Oct 1, 2018
@chrisbreiding chrisbreiding modified the milestones: Sprint 4, Sprint 5 Oct 3, 2018
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

10 participants