Conversation
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.
Status
READY
Description
Closes #88.
Related downstream request: relaystr/ndk#820
Add an optional
compressionEnabledconstructor parameter, defaulting totrue, so native clients can disable compression without giving up this library's automatic reconnection:The current native connector does not expose the
compressionparameter ofdart:io'sWebSocket.connect. This prevents downstream clients from opting out without maintaining a modified copy of the library. NDK's linked issue describes the motivation and workload-specific memory measurements for long-running clients with multiple relay connections. This is a configurable tradeoff, not a claim that compression is a leak or should be disabled by default: disabling compression can increase bandwidth for compressible messages.Implementation
truetoCompressionOptions.compressionDefaultandfalsetoCompressionOptions.compressionOffin the native connector.dart:iotypes and preserve existing defaults, backoff, and lifecycle behavior.Verification
dart test: all 33 tests pass.dart analyze --fatal-infos: no issues.dart formaton changed Dart implementation/test files: no remaining changes.compressionEnabled: false: passes. This checks web compilation, not browser runtime behavior.The new loopback integration test runs default and compression-disabled clients together against a compression-capable server. It checks both request extension offers and response negotiation headers on initial connection and forced reconnect. It also checks custom headers, subprotocol selection, and text/binary round trips across reconnects, including continuity of an existing message subscription.
Type of Change