Repository navigation
harden(app): fence retired websocket connection attempts - #14843
Merged
Merged
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.
Problem
PureSocket.connect()could be retired while asynchronous auth or WebSocket readiness was still pending. A later callback could then install or publish a stale channel, concurrent callers could open duplicate handshakes, and a connecting channel was not always closed on teardown. Those paths retain socket work after capture stops and can duplicate the heartbeat/recovery work that the mobile battery investigation is tracking.Change
Verification
pure_socket_lifecycle_test.dartandpure_socket_auth_test.dart).dart analyze lib/services/sockets/pure_socket.dart test/unit/pure_socket_lifecycle_test.dart: passed.bash scripts/analyze_ratchet.sh: passed.git diff --check: passed.Scope and limits
This changes transport lifecycle ownership only; reconnect and ping cadence are unchanged. The physical-device battery baseline remains unmeasured on this machine, so the PR claims reduced stale background work and preserved capture/recovery behavior rather than a phone battery percentage. Follow-up measurement should use a physical iPhone with fixed app/OS/firmware versions and repeated disconnected-idle, connected-muted, live-speech, connected-silence, offline-catch-up, and weak-network runs while recording Instruments Energy Log, network activity, process wakeups, and Omi lifecycle counters.
Relates to #5491, #11307, and #5221. #14688 is intentionally outside this change.