fix: always use ConnectTimeout when connecting the WebSocket#27
Merged
deleteLater merged 3 commits intofeatbit:mainfrom Jun 20, 2025
Merged
fix: always use ConnectTimeout when connecting the WebSocket#27deleteLater merged 3 commits intofeatbit:mainfrom
deleteLater merged 3 commits intofeatbit:mainfrom
Conversation
Contributor
Author
|
@deleteLater please review |
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR centralizes timeout handling by ensuring all WebSocket connection and close operations use the configured ConnectTimeout and CloseTimeout from FbOptions.
- Inject
FbOptionsintoWebSocketTransportandFbWebSocket - Update
StartAsyncsignatures to drop ad-hoc timeout parameters and rely on options - Extend tests to cover connection timeout behavior
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tests/FeatBit.ServerSdk.Tests/Transport/WebSocketsTransportTests.cs | Updated transport factory calls to accept FbOptions and added a timeout test |
| tests/FeatBit.ServerSdk.Tests/TestApp.cs | Modified CreateWebSocketTransport to require FbOptions |
| src/FeatBit.ServerSdk/Transport/WebSocketTransport.cs | Applied ConnectTimeout/CloseTimeout from options and removed inline parameters |
| src/FeatBit.ServerSdk/Transport/FbWebSocket.cs | Refactored transport factory to accept FbOptions and reordered ConnectAsync parameters |
| src/FeatBit.ServerSdk/DataSynchronizer/WebSocketDataSynchronizer.cs | Simplified StartAsync but removed its use of ConnectTimeout |
Comments suppressed due to low confidence (2)
src/FeatBit.ServerSdk/DataSynchronizer/WebSocketDataSynchronizer.cs:67
- The updated DataSynchronizer
StartAsyncno longer enforces a connect timeout; consider adding a unit test to verify thatConnectTimeoutis honored in this code path.
public Task<bool> StartAsync()
src/FeatBit.ServerSdk/Transport/FbWebSocket.cs:257
- A positional argument follows a named argument here, which is invalid in C#. Change to
ConnectAsync(isReconnecting: true, cancellationToken: _stopCts.Token)or reorder parameters.
await ConnectAsync(isReconnecting: true, _stopCts.Token).ConfigureAwait(false);
Contributor
|
I have made some nit changes and will test this PR tomorrow morning. |
Contributor
|
LGTM! Thanks for the fix. |
deleteLater
approved these changes
Jun 20, 2025
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Change all connection attempts to use the configured
ConnectTimeout, including reconnect attempts.Fixes #26