keiser_metrics_connection 2.0.0
keiser_metrics_connection: ^2.0.0 copied to clipboard
Dart package for Keiser Metrics to handle both websockets and rest calls.
2.0.0 #
Breaking changes
- Removes the public
open()method; the connection now opens automatically from the constructor, so callers should no longer callconnection.open() - Removes the
socketRetryTimeoutparameter in favor of the new exponential backoff
New features
- Replaces the fixed retry-timeout ladder with jittered exponential backoff for socket and REST reconnects (1 second floor, capped at 5 minutes)
- Gates the backoff reset behind a stability window so a server that accepts the handshake then immediately drops is backed off instead of hammered at the floor
- Adds
connectionReconnectDelayto override the computed backoff with a fixed delay for both socket and REST reconnection attempts - Switches the websocket to
IOWebSocketChannelwith a native 30 second ping interval and built-in connect timeout
Bug fixes
- Routes socket errors through teardown so awaiters receive an error instead of hanging when the connection drops
- Coordinates concurrent
616token-refresh responses through a shared refresh completer so the refresh token is spent once and other requests retry with the new access token - Adds an
_isRestRetryingsingle-flight guard so concurrent connection errors no longer spawn competing REST retry loops that race the backoff counter and tear down each other's Dio - Fixes the request queue stalling with budget free and items still waiting
- Guards
_checkIfAuthenticatedagainst non-map payloads - Cancels all lifecycle timers and resets backoff counters on
close() - Guards state emits against closed controllers and dedupes them so consumers stop receiving duplicate events
- Guards socket reopen against a connection closed during the retry delay
Maintenance
- Switches the analyzer config from
flutter_lintstopackage:lints/recommended.yamlto match this pure-Dart package - Removes the manual
connection.open()call from the example
1.1.0 #
- Keeps server online when a REST request fails with a connection error but the websocket is still connected, avoiding unnecessary reconnect and re-auth cycles
- Rebuilds the REST client lazily for body requests when Dio is unavailable but the socket is still connected
- Drains pending requests on disconnect so callers receive an error immediately instead of hanging indefinitely
- Fixes race condition in websocket message ID tracking
- Adds per-message socket timeout via
socketMessageTimeout(default 45 seconds); renamesdefaultSocketTimeouttodefaultSocketConnectionTimeout - Automatically closes the connection when server status transitions to offline
- Fixes multipart upload retries by cloning
MultipartFilevalues before each attempt
1.0.1 #
- Sets server status to online on successful request
1.0.0 #
- Adds support for new server tokens
0.7.4 #
0.7.3 #
- Fixes missing error exception type
connectionError
0.7.2 #
- Fixes issue related to Dio update
0.7.1 #
- Fixes issue related to Dio update
0.7.0 #
- Updates Dio dependency to v5.7.0
0.6.0 #
- Updates error model to include
paramsfield.
0.5.0 #
- Adds method to clear authentication state
clearAuthentication.
0.4.1 #
- Fixes invalid or expired tokens from being used again.
0.4.0 #
- Adds the parameter to override the default socket connection retry timeout.
0.3.1 #
- Fixes chat room message parsing
0.3.0 #
- Adds Machine JWT implementation
0.2.2 #
- Fixes settings sever status to offline after an HTTP request.
0.2.1 #
- Fixes authenticated state when an blacklisted token error is triggered.
0.2.0 #
- Adds
onChatRoomMessagestream to listen for any "live" chat room messages.
0.1.0 #
- Initial Release