-
Couldn't load subscription status.
- Fork 5.5k
Fix issues with rails/actioncable in the server sdk #14714
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
Merged
Merged
Changes from 1 commit
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
08732f1
Fix issues with rails/actioncable
adolfo-pd 39bb683
Safer fix that can't hurt the client sdk accidentally
adolfo-pd dec9efe
Linting and minor fix
adolfo-pd 054ca03
Update packages/sdk/src/server/async.ts
adolfo-pd 1b40276
Bump version and add CHANGELOG
adolfo-pd 0f3199d
Fix changelog
adolfo-pd 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
Oops, something went wrong.
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.
🛠️ Refactor suggestion
Consider a more robust approach for handling browser APIs in Node.js
The current implementation adds global no-op event listeners, which could mask potential issues by silently ignoring events. Consider using a proper polyfill or environment-specific implementation.
Also, fix the linting issues by adding semicolons:
declare global { - function addEventListener(type: string, listener: () => void): void - function removeEventListener(type: string, listener: () => void): void + function addEventListener(type: string, listener: () => void): void; + function removeEventListener(type: string, listener: () => void): void; } -global.addEventListener = () => {} -global.removeEventListener = () => {} +global.addEventListener = () => {}; +global.removeEventListener = () => {};📝 Committable suggestion
🧰 Tools
🪛 eslint (1.23.1)
[error] 8-9: Missing semicolon.
(@typescript-eslint/semi)
[error] 9-10: Missing semicolon.
(@typescript-eslint/semi)
[error] 11-11: Unexpected empty arrow function.
(@typescript-eslint/no-empty-function)
[error] 11-12: Missing semicolon.
(@typescript-eslint/semi)
[error] 12-12: Unexpected empty arrow function.
(@typescript-eslint/no-empty-function)