Skip to content

fix(pair): say why Astation's connection closed during verification - #66

Closed
guohai wants to merge 1 commit into
mainfrom
fix/pair-verify-diagnostics
Closed

guohai wants to merge 1 commit into
mainfrom
fix/pair-verify-diagnostics

Conversation

@guohai

@guohai guohai commented Oct 15, 2026

Copy link
Copy Markdown
Contributor

Summary

atem pair failed with "Astation connection closed during device verification" after the safety codes matched, with no way to tell why: the WebSocket reader dropped the close frame's reason and silently dropped any Astation message it couldn't parse.

  • The reader records how the socket ended (close code + reason, a transport error, or no close frame) and the type of each message that didn't parse (never its content; at most 8 per socket).
  • atem pair appends both to the error, e.g. Astation connection closed during device verification (closed by Astation: 1008 "signing failed"; unreadable messages from Astation: deviceVerified).

Heartbeats were considered and left out: Atem doesn't send them anywhere today, and long-lived TUI connections stay up, so an idle close is unlikely.

Testing

  • New test: a fake Astation sends an unparseable deviceVerified then closes with 1008 "signing failed"; the error names both.
  • cargo test: 1266 unit + agent_launch_binary 3, key_agent_binary 2, terminal_ui_binary 2, all pass. Clippy: no new warnings.

Generated with SMT smt@agora.build

The WebSocket reader now records the close frame (code and reason) or the
transport error, and the types of Astation messages it couldn't parse
(dropped before, silently). 'atem pair' adds both to the error when the
connection closes while it waits for Astation's reply.

🤖 Built with SMT <smt@agora.build>
@guohai

guohai commented Oct 15, 2026

Copy link
Copy Markdown
Contributor Author

Dropped: under the approved session-multiplexing design, atem pair no longer reconnects an already paired profile, and connection ownership moves to the shared runtime. Close reasons (incl. the relay's replaced-connection code) will be captured there as part of the runtime's transport handling instead of as a pair-only diagnostic.

Generated with SMT smt@agora.build

@guohai guohai closed this Oct 15, 2026
@guohai
guohai deleted the fix/pair-verify-diagnostics branch October 15, 2026 22:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant