fix: align mobile subscription docs and behavior #22

Merged
graham merged 1 commit from fix/w5-mobile-subscription-docs into main 2026-09-15 16:34:13 -05:00
Owner

Fixes W5 from bugs.md.

The code enforces one registration per socket — subscribing to a callsign releases the viewport and vice versa — but the docs claimed both subscriptions could be combined. Rewrites the subscribe_callsign note to state the replacement contract explicitly, including that unsubscribe_callsign does not restore a previous viewport. Also removes the now-provably-dead bounds fallback branch and orphaned packet_in_bounds?/2 in should_queue_packet?/2, with a comment pinning the invariant.

Verification: focused channel tests passed (60), full suite passed (2235), mix credo --strict, and commit hooks including Dialyzer passed.

Fixes W5 from bugs.md. The code enforces one registration per socket — subscribing to a callsign releases the viewport and vice versa — but the docs claimed both subscriptions could be combined. Rewrites the `subscribe_callsign` note to state the replacement contract explicitly, including that `unsubscribe_callsign` does not restore a previous viewport. Also removes the now-provably-dead bounds fallback branch and orphaned `packet_in_bounds?/2` in `should_queue_packet?/2`, with a comment pinning the invariant. Verification: focused channel tests passed (60), full suite passed (2235), `mix credo --strict`, and commit hooks including Dialyzer passed.
fix: align mobile subscription docs and behavior
All checks were successful
Elixir CI / Build and test (pull_request) Successful in 56s
skippy-bot/review Skippy review: clean — no open findings
Elixir CI / Dialyzer (pull_request) Successful in 2m54s
Elixir CI / Build and Push Docker Image (pull_request) Has been skipped
39ba02dbe7
First-time contributor

Clean review — no findings.

Verified the removed branch really was unreachable: bounds is only ever assigned in subscribe_to_bounds/3 (which calls release_callsign_subscription/1 first) and finish_bounds_update/2 (reachable only with subscribed == true, set solely inside subscribe_to_bounds/3), so a non-nil tracked_callsign implies bounds == nil and the old packet_in_bounds?(nil, _) fallback could only ever return false. Behaviour is unchanged.

New note matches the code, including that unsubscribe_callsign leaves the socket with no viewport. Non-blocking: the subscribe_bounds section still doesn't mention the reverse release, so a reader who starts there won't learn their callsign tracking was dropped.

Clean review — no findings. Verified the removed branch really was unreachable: `bounds` is only ever assigned in `subscribe_to_bounds/3` (which calls `release_callsign_subscription/1` first) and `finish_bounds_update/2` (reachable only with `subscribed == true`, set solely inside `subscribe_to_bounds/3`), so a non-nil `tracked_callsign` implies `bounds == nil` and the old `packet_in_bounds?(nil, _)` fallback could only ever return `false`. Behaviour is unchanged. New note matches the code, including that `unsubscribe_callsign` leaves the socket with no viewport. Non-blocking: the `subscribe_bounds` section still doesn't mention the reverse release, so a reader who starts there won't learn their callsign tracking was dropped. <!-- skippy-pr-review -->
graham merged commit 696012eada into main 2026-09-15 16:34:13 -05:00
graham deleted branch fix/w5-mobile-subscription-docs 2026-09-15 16:34:13 -05:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
graham/aprs.me!22
No description provided.