Skip to content

Fix Quick Share receiving and duplicate discovery - #157

Open
hkay-dev wants to merge 2 commits into
sameerasw:mainfrom
hkay-dev:codex/android-quick-share-receive
Open

hkay-dev wants to merge 2 commits into
sameerasw:mainfrom
hkay-dev:codex/android-quick-share-receive

Conversation

@hkay-dev

@hkay-dev hkay-dev commented Sep 24, 2026 •

Copy link
Copy Markdown

AI-assisted: Codex helped write and review this code and PR.

Why

The receiver sent ACCEPT before opening its Downloads output stream. The Mac could begin sending before Android was ready, leaving a pending file even when the sender reported success. During testing, duplicate discovery requests also registered a second mDNS service and coincided with the Mac staying on Connecting.

What changed

  • Open the Downloads output stream before sending ACCEPT. Require that stream for payload data, check the final byte count, and clear MediaStore's pending flag only for a complete file.
  • Start the handshake after the service installs connection callbacks. Failed connections now close and notify the service once, and the active-connection map supports calls from different threads.
  • Ignore a duplicate discovery request while discovery is active.

Checks

  • :app:assembleDebug passes.
  • Two consecutive Mac-to-Android sends completed using a side-by-side Android test build. A later send from the final Mac branch also appeared in /sdcard/Download/, matched the Mac copy by SHA-256, and had is_pending=0 in MediaStore.
  • No manifest, settings, build file, dependency, or wire-format changes.

Notes

This changes inbound Quick Share and duplicate discovery only. Other Android file-saving paths are unchanged.

Companion Mac PR: sameerasw/airsync-mac#301

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