Files
bitchat/bitchatTests/Services
bd603386d5 Stop presence and the bridge cell once location access is revoked (#1851)
Revoking location access mid-session left kind-20001 presence going to
the last region, province and city cells until relaunch, and kept the
mesh bridge's rendezvous on the last neighborhood cell. Both read
LocationStateManager.availableChannels, which outlived the permission,
and neither checked the permission itself.

- GeohashPresenceService checks the permission before each heartbeat
  and again after the decorrelation delay. The loop keeps running, so
  presence resumes once access comes back.
- The bridge's locationCell goes through BridgeService.ownLocationCell,
  which returns nil without authorization, so the rendezvous closes and
  no presence or message copy goes to the old cell.
- LocationStateManager forgets the last fix (channels and place names)
  when access is revoked, before the new permission state publishes. A
  fix CoreLocation delivers after the revocation is ignored and not
  geocoded, and a place-name lookup that lands late is dropped.

NearbyNotesCounter and GeoChannelCoordinator keep their own permission
checks. Three tests asserted that the channel list survives revocation;
they now assert it is cleared.

Co-authored-by: jack <jackjackbits@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-27 09:32:14 -10:00
..