Skip to content

feat(drop): receive over STUN alone when the node runs no TURN server - #90

Merged
TheCryptoDonkey merged 2 commits into
feat/direct-stun-protocolfrom
feat/drop-stun-default
Oct 23, 2026
Merged

TheCryptoDonkey merged 2 commits into
feat/direct-stun-protocolfrom
feat/drop-stun-default

Conversation

@TheCryptoDonkey

Copy link
Copy Markdown
Member

Stacked on #89 (protocol and vectors); the base is that branch and GitHub will retarget it when #89 merges. Pairs with forgesworn/wildbloom#104 (the page).

Drop no longer needs the node to run a TURN issuer. It fails neither with no_turn nor before showing a link when there is none.

Changes (all under desktop/):

  • messages.rs: IceServer::well_formed takes the two forms (any TURN URL: username and credential 1 to 256 bytes; STUN URLs only: both empty). The "no TURN URL" check is gone from the reader and from the encoder, which now refuses hide: true without a TURN URL instead, so Drop never sends a hidden invitation it cannot honour. New DEFAULT_STUN_URL = "stun:stun.cloudflare.com:3478" and default_stun(); a test pins the exact string (the page has the matching test) and that it names no ForgeSworn host.
  • client.rs: the issuer reply parser accepts STUN-only entries with empty credentials and refuses a STUN-only entry with a credential, a TURN entry with an empty field, and so on.
  • receive.rs: a 404 from the issuer becomes the built-in STUN entry for both ends (expires: 0, which a direct send does not read). With hiding on and no TURN URL it returns no_relay before open_pairing, so no link is made and no relay session is allocated. This is a small pure function, ice_for_receive, with unit tests for each answer. no_turn is removed.
  • The hide setting defaults to off for installs that never set it (stored on stays on, stored off stays off). Settings status, app.js, drop.js and the test stub follow. This is the owner-decided flip.
  • session.rs: a session that never connects reports connect_direct instead of connect when no TURN URL was on offer.
  • UI copy and DROP-IPC.md: no_turn removed; no_relay now points to Settings; connect_direct added ("...Some networks, like mobile data or work Wi-Fi, don't allow it. Nothing was kept.").
  • Vendored bundle rebuilt with scripts/vendor-direct.mjs from forgesworn/wildbloom feat/direct-stun-page at e04bdef (the page code commit). The provenance names that commit. If #104 is squash-merged, rebuild from the merge commit before releasing Drop (node scripts/vendor-direct.mjs --checkout ../wildbloom --commit <sha>).

Tests run (local, macOS): cargo test --locked --manifest-path desktop/src-tauri/Cargo.toml (after fixing one harness assertion of mine; the run that failed was my own new test), then the drop:: tests again after cargo fmt; cargo clippy --all-targets -D warnings on the desktop crate; node desktop/tests/drop-ui.mjs (71 scenarios), node desktop/tests/direct-window.mjs (15, including a new one that a STUN-only server reaches RTCPeerConnection with no username or credential member); vendor-direct.mjs --check --checkout rebuilds byte for byte. pools-ui.mjs and the native acceptance scripts were not run.

Spec deviations: the session tests for "404 gives the default invite" and "hide on plus 404" are unit tests of ice_for_receive plus the harness test for connect_direct; a full open_receive test needs a live node and device identity (the e2e harness), which I did not extend. The Drop release, the hide-default flip going out, and signing remain owner decisions; nothing is released or tagged.

Drop accepts an ICE entry of STUN URLs with empty credentials, and when the
node answers 404 for the issuer it uses a built-in stun:stun.cloudflare.com:3478
for both ends instead of failing with no_turn. Hiding needs a TURN URL, so a
receive with hiding on refuses with no_relay before any link is shown, and the
encoder never sends a hidden invitation without one. The hide setting now
defaults to off for installs that never set it; a stored on or off is kept.
A connection that fails with no relay on offer reports connect_direct. The
vendored direct-send bundle is rebuilt from the page change.
@TheCryptoDonkey
TheCryptoDonkey merged commit b9aa792 into feat/direct-stun-protocol Oct 23, 2026
7 of 8 checks passed
@TheCryptoDonkey
TheCryptoDonkey deleted the feat/drop-stun-default branch October 23, 2026 20:48
TheCryptoDonkey added a commit that referenced this pull request Oct 23, 2026
…ncludes #90)

Protocol and vectors for STUN-only direct send, plus the Drop changes from #90: the Drop reader and encoder accept STUN-only invitations, the built-in Cloudflare STUN default, hide off unless set to on, and the bundle re-vendored from the merged page commit.
@TheCryptoDonkey

Copy link
Copy Markdown
Member Author

Included in #89, which carries these commits and was squash-merged to main.

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