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

fix: Add existential operators to properties before calling split in processBrowserPreRequest #28952

Merged
merged 10 commits into from
Feb 15, 2024

Conversation

jennifer-shehane
Copy link
Member

@jennifer-shehane jennifer-shehane commented Feb 15, 2024

Additional details

Seems this was introduced in #28517

If these properties don't exist, they should no longer crash. It may result in null values for some of the properties we're trying to check to process service worker requests, but this seems better than outright crashing. Perhaps there's a better long term solution to ensure these exist before getting these values.

Steps to test

Good question. I have no idea why this would even be the case and don't see a clear way to unit test it.

How has the user experience changed?

Users should not see cypress crash with:

Cannot read properties of undefined (reading 'split')
TypeError: Cannot read properties of undefined (reading 'split')
    at <embedded>:4432:32336
    at Map.forEach (<anonymous>)
    at i.processBrowserPreRequest (<embedded>:4432:32254)
    at N.shouldIgnorePendingRequest (<embedded>:4432:42079)
    at N.addPendingBrowserPreRequest (<embedded>:4432:41117)
    at d (<embedded>:4432:40190)
    at _ (<embedded>:4432:36011)
    at _.emit (node:events:513:28)
    at f (<embedded>:4491:55225)
    at onEnd (<embedded>:4491:55769)
    at q (<embedded>:4491:53135)
    at N (<embedded>:4491:53761)
    at ee.<anonymous> (<embedded>:4491:55678)
    at ee.emit (node:events:525:35)
    at ee.onRequestError (<embedded>:2050:100575)
    at ClientRequest.emit (node:events:525:35)
    at Socket.socketErrorListener (node:_http_client:502:9)
    at Socket.emit (node:events:513:28)
    at emitErrorNT (node:internal/streams/destroy:151:8)
    at emitErrorCloseNT (node:internal/streams/destroy:116:3)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
GET /__cypress/runner/fonts/fa-solid-900.woff2 200 1.204 ms - 126828
The Test Runner unexpectedly exited via a exit event with signal SIGABRT

PR Tasks

Copy link

cypress bot commented Feb 15, 2024

4 flaky tests on run #54047 ↗︎

0 5499 77 0 Flakiness 4

Details:

Merge branch 'develop' into processBrowserPreRequest-split-crash
Project: cypress Commit: 6c54e8e4fa
Status: Passed Duration: 17:48 💡
Started: Feb 15, 2024 5:53 PM Ended: Feb 15, 2024 6:11 PM
Flakiness  net_stubbing.cy.ts • 1 flaky test • 5x-driver-chrome

View Output

Test Artifacts
network stubbing > waiting and aliasing > yields the expected interception when two requests are raced Test Replay
Flakiness  querying/querying.cy.js • 1 flaky test • 5x-driver-chrome

View Output

Test Artifacts
... > intercept aliases > returns the xhr Test Replay
Flakiness  waiting.cy.js • 1 flaky test • 5x-driver-chrome

View Output

Test Artifacts
... > errors > throws when waiting for response to route Test Replay
Flakiness  files.cy.js • 1 flaky test • 5x-driver-chrome

View Output

Test Artifacts
... > throws a specific error when file exists when it shouldn't Test Replay

Review all test suite changes for PR #28952 ↗︎

@ryanthemanuel
Copy link
Collaborator

This is frustrating because according to the docs those are both required fields. Hmmm.

Co-authored-by: Ryan Manuel <ryanm@cypress.io>
@ryanthemanuel
Copy link
Collaborator

I added the comments defaulting to '' as I think if they would have also crashed a couple of lines later. Looks good now though.

@jennifer-shehane jennifer-shehane merged commit a0b2d1e into develop Feb 15, 2024
80 of 82 checks passed
@jennifer-shehane jennifer-shehane deleted the processBrowserPreRequest-split-crash branch February 15, 2024 18:29
@MikeMcC399
Copy link
Contributor

MikeMcC399 commented Feb 16, 2024

@this PR is already merged, however the changelog link is incorrect:

Fixed a regression introduced in [`13.6.3`](https://docs.cypress.io/guides/references/changelog#13.6.3) where Cypress could crash when processing service worker requests through our proxy. Fixes [#28950](https://github.com/cypress-io/cypress/issues/28950).

It should be

[`13.6.3`](https://docs.cypress.io/guides/references/changelog#13-6-3)

if 13.6.3 is going to work correctly.

@jennifer-shehane
Copy link
Member Author

@MikeMcC399 Thanks Mike!

@cypress-bot
Copy link
Contributor

cypress-bot bot commented Feb 20, 2024

Released in 13.6.5.

This comment thread has been locked. If you are still experiencing this issue after upgrading to
Cypress v13.6.5, please open a new issue.

@cypress-bot cypress-bot bot locked as resolved and limited conversation to collaborators Feb 20, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

SIGABRT: Cannot read properties of undefined (reading 'split') | i.processBrowserPreRequest
5 participants