-
Notifications
You must be signed in to change notification settings - Fork 10.4k
Blazor Disable Non-WebSockets Transports by Default #34644
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
16 commits
Select commit
Hold shift + click to select a range
c4b3a17
Blazor Disable Non-WebSockets Transports by Default
TanayParikh fab2c82
Update dist .js files
TanayParikh e03d084
Added UnsupportedTransportWebSocketsError
TanayParikh f1dbafc
Merge branch 'main' into taparik/disableNonWSTransportsByDefault
TanayParikh 895afb2
Added FailedToStartTransportError
TanayParikh ce0ba7d
E2E Tests
TanayParikh b2dc979
Updated async awaits
TanayParikh dfd0128
Remove ErrorIfBrowserDoesNotSupportWebSockets
TanayParikh 3bb93eb
MultipleErrors Approach
TanayParikh 1c3e8f6
Always show error notification if `connection.start` throws
TanayParikh 221503a
Merge branch 'main' into taparik/disableNonWSTransportsByDefault
TanayParikh b55777f
PR Feedback
TanayParikh 61a27b7
Fix transport failed exception handling
TanayParikh 6b6c71e
TransportsServerStartup && ErrorIfClientAttemptsWebSocketsWithServerO…
TanayParikh 5f8b828
Fix Build
TanayParikh 0668383
Update src/Components/test/testassets/TestServer/Pages/Transports.cshtml
TanayParikh 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
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.
Would we be able to change SignalR to throw a type and use that here instead of string sniffing: https://developer.mozilla.org/en-US/docs/web/javascript/reference/statements/throw#throw_an_object?
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.
cc/ @BrennanConroy would you be open to this change?
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'm not against throwing a specific error type at
aspnetcore/src/SignalR/clients/ts/signalr/src/HttpConnection.ts
Line 408 in 3eb0fa8
Much better than doing string matching since those can change at any time.
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.
Just added a
Error.name
here:e03d084#diff-757d83bcf707b34888c824c952e4717638803af7b5372f6c5da1eb838f1a5814R450-R452
Due to the way exception nesting is done in the
HttpConnection
, having the name itself propagate up would likely require a lot more extensive changes. Instead, I'm still relying a bit on string sniffing, but I'm sniffing the customError.name
instead of the message.e03d084#diff-7c47c684c78e3f5b5eeecb28b249b03afcefcd90a925cc20b69ec2cdec261752R134
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.
What was wrong with changing the type of exception we throw?
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.
If you're referring to here:
aspnetcore/src/SignalR/clients/ts/signalr/src/HttpConnection.ts
Line 408 in 3eb0fa8
Several different issues can result in an exception being thrown there. So changing the exception type being thrown there wouldn't provide us with specific enough information (ie. diagnose a WS failed connection).
If it's for changing the exception type here instead of the name:
e03d084#diff-757d83bcf707b34888c824c952e4717638803af7b5372f6c5da1eb838f1a5814R451
I just wanted to avoid adding an additional exception type when the spec compliant
Error.name
would be sufficient for our purposes. Let me know if you feel otherwise and I can add it in.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.
Updated 895afb2.