Skip to content

Keep the AirDrop receiver identity stable across restarts - #129

Open
NivedV1 wants to merge 3 commits into
t4t5:mainfrom
NivedV1:fix/receiver-stable-identity
Open

NivedV1 wants to merge 3 commits into
t4t5:mainfrom
NivedV1:fix/receiver-stable-identity

Conversation

@NivedV1

@NivedV1 NivedV1 commented Nov 18, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes #125. Restarting owly receive could leave multiple entries for the same receiver in the AirDrop picker. The receiver now reuses an mDNS service ID stored in its state directory and sends a TTL-zero goodbye on graceful shutdown.

  • Publish the ID atomically so concurrent starts sharing a state directory use the same value. Report unreadable or malformed ID files and preserve them.
  • Skip receiver ID storage when --no-mdns is set.
  • Wait up to two seconds for the socket to accept the goodbye and report any send error or timeout.

Verification

  • All 89 unit tests passed across owly-cli and owly-airdrop. Coverage includes ID persistence, concurrent creation, malformed ID preservation, and zero TTL on all goodbye records.
  • Tested on an iPhone with the AirDrop picker open. After Ctrl-C, the receiver entry disappeared in 2–3 seconds. Restarting before or after it disappeared never showed more than one entry.

Publish a stable mDNS instance id from the state directory so Apple peers
don't list a new receiver on every 'owly receive' (t4t5#125), and await the
TTL-0 goodbye on exit so stale records are withdrawn before the runtime
is dropped.

Tests: id persistence across restarts and goodbye with TTL 0.
@NivedV1
NivedV1 marked this pull request as ready for review November 18, 2026 00:45
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.

Multiple devices appear on Apple devices

1 participant