-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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: WebSocket Connection Closed crashing from BrowserCriClient #30174
Merged
cacieprins
merged 9 commits into
develop
from
cacie/30100/browser-cri-client-websocket-closed
Sep 3, 2024
Merged
fix: WebSocket Connection Closed crashing from BrowserCriClient #30174
cacieprins
merged 9 commits into
develop
from
cacie/30100/browser-cri-client-websocket-closed
Sep 3, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cacieprins
changed the title
Fix: Further manifestations of WebSocket Closed crashes
Fix: WebSocket Connection Closed crashing from BrowserCriClient
Sep 3, 2024
cacieprins
changed the title
Fix: WebSocket Connection Closed crashing from BrowserCriClient
fix: WebSocket Connection Closed crashing from BrowserCriClient
Sep 3, 2024
cacieprins
force-pushed
the
cacie/30100/browser-cri-client-websocket-closed
branch
4 times, most recently
from
September 3, 2024 14:55
9fa116f
to
931d2f0
Compare
cacieprins
force-pushed
the
cacie/30100/browser-cri-client-websocket-closed
branch
from
September 3, 2024 14:59
931d2f0
to
0e9afce
Compare
ryanthemanuel
approved these changes
Sep 3, 2024
AtofStryker
approved these changes
Sep 3, 2024
Co-authored-by: Bill Glesias <bglesias@gmail.com>
cypress Run #56927
Run Properties:
|
Project |
cypress
|
Branch Review |
cacie/30100/browser-cri-client-websocket-closed
|
Run status |
Passed #56927
|
Run duration | 17m 30s |
Commit |
eab555bdae: Merge branch 'develop' into cacie/30100/browser-cri-client-websocket-closed
|
Committer | Cacie Prins |
View all properties for this run ↗︎ |
Test results | |
---|---|
Failures |
0
|
Flaky |
1
|
Pending |
73
|
Skipped |
0
|
Passing |
5592
|
View all changes introduced in this branch ↗︎ |
Warning
No Report: Something went wrong and we could not generate a report for the Application Quality products.
cacieprins
deleted the
cacie/30100/browser-cri-client-websocket-closed
branch
September 3, 2024 22:25
gweesin
pushed a commit
to gweesin/cypress
that referenced
this pull request
Sep 4, 2024
…ess-io#30174) * catch Fetch.enable errors on extra target in browser CRI * changelog * changelog * changelog * Update packages/server/test/unit/browsers/browser-cri-client_spec.ts Co-authored-by: Bill Glesias <bglesias@gmail.com> * use try/catch instead of .catch for wider unit test support --------- Co-authored-by: Bill Glesias <bglesias@gmail.com>
Released in This comment thread has been locked. If you are still experiencing this issue after upgrading to |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
BrowserCriClient
destroys an extra target while that target is being initialized, the App crashes #30100Additional details
When the BrowserCRIClient attaches to a target, it determines if the new target is an "extra target" or not. As a part of this process, it creates a raw CDPClient instance and sends a
Fetch.enable
command. If this extra target is closed before that command can resolve, CDPClient will throw aWebSocket Connection Closed
error. If this error is uncaught, it will crash Cypress.To fix this, the command is wrapped in try/catch, and logs a debug entry for the error if an error is encountered.
This could have been fixed by using the more resilient
CRIClient
class, butBrowserCRIClient
is fairly complex, and this approach has a smaller change footprint.BrowserCRIClient
is a candidate for similar refactors that were made toCRIClient
, recently.Steps to test
As this error is very difficult to reproduce intentionally, the only test available is a unit test.
How has the user experience changed?
PR Tasks
cypress-documentation
?type definitions
?