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

Do not abort XHR's on unload #2968

Closed
brian-mann opened this issue Dec 19, 2018 · 9 comments · Fixed by #2969
Closed

Do not abort XHR's on unload #2968

brian-mann opened this issue Dec 19, 2018 · 9 comments · Fixed by #2969
Assignees
Labels
type: unexpected behavior User expected result, but got another

Comments

@brian-mann
Copy link
Member

Current behavior:

Whenever Cypress encounters the page unloading, it will automatically call xhr#abort on all open XHR's. This is unnecessary as the browser will automatically abort it under the hood.

Aborting it manually is not only incorrect, but this will trigger the native abort() handlers which can cause errors in the client application.

Desired behavior:

Allow the native browser behavior to propagate and simply update the UI state to match what would be seen by the Network tab in dev tools.

@brian-mann brian-mann added the type: unexpected behavior User expected result, but got another label Dec 19, 2018
@brian-mann brian-mann self-assigned this Dec 19, 2018
@jennifer-shehane jennifer-shehane added the stage: needs review The PR code is done & tested, needs review label Dec 19, 2018
@arpowers
Copy link

related to #2374 ?

@jennifer-shehane
Copy link
Member

@arpowers I can't be sure this is related to that issue since we were never able to reproduce #2374, but you're welcome to pull down the PR and see if the related issue is fixed. PR: #2969

brian-mann added a commit that referenced this issue Dec 19, 2018
@jennifer-shehane jennifer-shehane added stage: pending release and removed stage: needs review The PR code is done & tested, needs review labels Dec 20, 2018
@jennifer-shehane
Copy link
Member

The code for this is done, but this has yet to be released. We'll update this issue and reference the changelog when it's released.

@brian-mann
Copy link
Member Author

Released in 3.1.4.

@janhjordie
Copy link

Hey @brian-mann
I still have same issue in Electron. Also with the new 3.1.4.
And it both visual and headless Electron. It works just perfect in Chrome and Canary.
I'm running MacOS.

I reported this issue ealier #1652 (comment)

In my case is a bunch of SignalR request that runs in the application, and not any I actually use.
One of the SignalR request gets aborted and then stops the whole test

Please advise !

@sverrelorenzen
Copy link

Hi,

I have the same issue with Electron as @janhjordie.

Regards

@jennifer-shehane
Copy link
Member

Hey @janhjordie and @sverrelorenzen, could you open a new issue detailing a reproducible example of your issue (app code + test code). Thank you!

@13322211021
Copy link

image
Got the same issue with Electron as @janhjordie.
Did you get a workaround?@janhjordie, @sverrelorenzen
I use cypress 3.4.1.

@jennifer-shehane
Copy link
Member

This issue will be closed to further comment as the exact issue here was resolved and tested.

If you're experiencing a bug similar to this in Cypress, please open a new issue with a fully reproducible example that we can run. There may be a specific edge case with the issue that we need more detail to fix.

@cypress-io cypress-io locked as resolved and limited conversation to collaborators Dec 24, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type: unexpected behavior User expected result, but got another
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants