Skip to content

Hang up on a message the pod can't use instead of exiting - #23

Merged
ps2 merged 1 commit into
mainfrom
recover-from-bad-input
Oct 12, 2026
Merged

ps2 merged 1 commit into
mainfrom
recover-from-bad-input

Conversation

@ps2

@ps2 ps2 commented Oct 12, 2026

Copy link
Copy Markdown

Pairing, session setup and the command loop exited the pod with log.Fatal when a message from the phone didn't parse, decrypt or unmarshal, and the packet layer exited on an unexpected command. In the Simulator nothing restarts the pod, so one bad message lost it. #20 hit this: an EAP-AKA Success that didn't parse.

  • Pairing, session setup and commands: the pod logs the error, hangs up and waits for the phone to reconnect and set up a new session. This also covers a response ACK that doesn't decrypt or isn't empty, which used to exit the pod after the command had already been applied.
  • Packet layer: an unexpected command is logged, and the pod carries on.
  • Still exits: errors in the pod's own work, like generating keys, saving state or building a response.

Testing

  • pkg/pod/pod_test.go sends a garbled message during session setup. On main it fails with the pod's EAP-AKA parse error; now the pod hangs up.
  • go test -race ./... passes, and it builds for GOOS=linux GOARCH=arm.
  • With Loop in the iOS Simulator, a session and a status read worked as before. The hang-up path is covered only by the unit test.

Pairing, session setup and the command loop exited the pod with
log.Fatal when the phone's message didn't parse, decrypt or unmarshal,
and the packet layer exited on an unexpected command. In the Simulator
nothing restarts it, so one bad message cost the pod.

The pod now logs the error, hangs up and waits for the phone to
reconnect and set up a new session. The packet layer logs and carries
on. Errors in the pod's own work (generating keys, saving state,
building responses) still exit.
@ps2
ps2 merged commit a491a5e into main Oct 12, 2026
1 check passed
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