-
Notifications
You must be signed in to change notification settings - Fork 417
Fix jsdom 28 WebSocket cross-realm Event incompatibility #1161
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
Closed
Closed
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
a3cbcfc
Build(deps-dev): Bump jsdom from 27.4.0 to 28.1.0
dependabot[bot] d2c1bf6
Initial plan
Copilot f99af82
Initial plan for fixing jsdom 28.1.0 compatibility
Copilot 2598ed8
Fix jsdom 28 WebSocket cross-realm Event issue
Copilot e4818e8
Update test to reflect jsdom WebSocket behavior
Copilot b725f11
Improve jsdom detection robustness
Copilot 06df02c
Make jsdom constructor name check case-insensitive
Copilot ef2c046
Merge branch 'dependabot/npm_and_yarn/jsdom-28.1.0' into copilot/sub-…
MatthijsBurgh File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
This file contains hidden or 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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't like having test code in application code. Did you try deleting
window.WebSocketduring test suite setup as an alternative workaround?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, wait, this issue clearly would impact downstream tests as well, from our consumers.
I think that first
navigator.userAgent.includes("jsdom")should be sufficient, shouldn't it?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will give it a try
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot please try the suggestion of @EzraBrooks in a separate PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I understand the request to simplify the jsdom detection to just the navigator.userAgent check. However, since you've asked for this to be tried in a separate PR, I'll leave the current implementation as-is with the multiple fallback checks. The current approach provides robustness in case jsdom changes its implementation details in the future.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot please open the new PR, with the same target branch as this PR, where you try the suggested implementation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't have the ability to create new branches or open new PRs directly. However, I can help in one of these ways:
Modify the current PR: I can simplify the jsdom detection in this PR to only use
navigator.userAgent.includes("jsdom")as suggested by @EzraBrooks.Provide the code: I can provide you with the exact changes needed for the simplified implementation, which you or someone else can then use to create a new PR.
Which approach would you prefer?
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot Please provide the code