unsubscribe says Not subscribed and keeps delivering packets while a callsign subscription is active #63

Open
opened 2026-11-03 18:52:32 +00:00 by skippy-bot · 0 comments

Problem

After subscribe_callsign, pushing the documented unsubscribe event replies {"status":"ok","response":{"message":"Not subscribed"}} and packets keep arriving. Only unsubscribe_callsign or a disconnect stops them, and the reply actively tells the client it was not subscribed.

Evidence

At 2f150f66:

  • lib/aprsme_web/channels/mobile_channel.ex:157 enters the release branch only if socket.assigns[:subscribed] && socket.assigns[:bounds], which is false while a callsign is tracked because the callsign path released the viewport.
  • lib/aprsme_web/channels/mobile_channel.ex:172 replies Not subscribed in that case.
  • docs/mobile-api.md:234 documents Unsubscribing as Stop receiving packets with no caveat about callsign subscriptions.

Expected

unsubscribe stops whichever subscription is active, or the docs say it only covers bounds and name unsubscribe_callsign.

How to verify

In mobile_channel_test.exs, push subscribe_callsign, then unsubscribe, then a matching spatial packet, and assert no packet push arrives. Today it does.

Acceptance criteria

  • unsubscribe releases a callsign subscription or says why it does not.
  • The docs match the behavior.
  • A test asserts no delivery after the documented unsubscribe.

Effort: S
Lens: api

## Problem After `subscribe_callsign`, pushing the documented `unsubscribe` event replies `{"status":"ok","response":{"message":"Not subscribed"}}` and packets keep arriving. Only `unsubscribe_callsign` or a disconnect stops them, and the reply actively tells the client it was not subscribed. ## Evidence At `2f150f66`: - `lib/aprsme_web/channels/mobile_channel.ex:157` enters the release branch only `if socket.assigns[:subscribed] && socket.assigns[:bounds]`, which is false while a callsign is tracked because the callsign path released the viewport. - `lib/aprsme_web/channels/mobile_channel.ex:172` replies `Not subscribed` in that case. - `docs/mobile-api.md:234` documents Unsubscribing as `Stop receiving packets` with no caveat about callsign subscriptions. ## Expected `unsubscribe` stops whichever subscription is active, or the docs say it only covers bounds and name `unsubscribe_callsign`. ## How to verify In `mobile_channel_test.exs`, push `subscribe_callsign`, then `unsubscribe`, then a matching spatial packet, and assert no packet push arrives. Today it does. ## Acceptance criteria - [ ] `unsubscribe` releases a callsign subscription or says why it does not. - [ ] The docs match the behavior. - [ ] A test asserts no delivery after the documented unsubscribe. **Effort:** S **Lens:** api
Sign in to join this conversation.
No description provided.