onStateChanged method
Records a connection-state transition. raw is the client's own state
object, retained as a stringified hint when present.
Implementation
@override
void onStateChanged(WsConnectionState state, {String? url, Object? raw}) {
if (!settings.enabled) return;
final useRedaction = settings.enableRedaction;
final normalizedUrl = _normalizeUrl(url, useRedaction).url;
_logger.wsState(
source: source,
state: state.name,
target: normalizedUrl,
correlationId: _connectionId,
config: useRedaction ? null : NetworkRedactionMixin.noRedactConfig,
consoleMessage: '→ state:${state.name} $normalizedUrl',
meta: {
'url': normalizedUrl,
if (raw != null) 'raw': '$raw',
},
);
}