Skip to content

fix(stream): send key edges on the control stream - #40

Merged
enricobuehler merged 1 commit into
mainfrom
fix/key-edges-control-stream
Sep 28, 2026
Merged

enricobuehler merged 1 commit into
mainfrom
fix/key-edges-control-stream

Conversation

@enricobuehler

Copy link
Copy Markdown
Contributor

Problem

A key press or release is one datagram, and a lost release holds the key on the host until its next edge. The native clients fixed this in punktfunk #1595: a host that advertises HOST_CAP2_INPUT_EDGES reads key edges off the control stream, where QUIC resends what the network drops. The browser client sends its own datagrams, so it needs the same routing.

Change

  • session keeps Welcome::host_caps2 beside host_caps and exposes its control writer to input.
  • input::send sends KeyDown/KeyUp as InputEdge on the control stream when the host has the bit; everything else, and everything toward an older host, stays a datagram.
  • punktfunk-core pin c6691fc1f → 25506f01b (the #1595 merge), which carries InputEdge and the capability bit. That core no longer exports reanchor::index_gap (folded into a quic-only tracker), so the four-line gap helper now lives in recovery.rs beside its only caller; the existing wrap and straggler tests cover it.

Tests

Client-web's Rust CI job run locally on this tree: cargo fmt --check, cargo clippy --all-targets -- -D warnings, cargo clippy --target wasm32-unknown-emscripten -- -D warnings, cargo test. Not on glass: a browser session against a host built from punktfunk main after #1595 is owed, with the nft 20 % loss recipe from #1543.

A key press or release was one datagram, and a lost release held the
key on the host until its next edge. A host that advertises
HOST_CAP2_INPUT_EDGES (punktfunk #1595) reads key edges off the control
stream, where the transport resends what the network drops, so the
browser sends KeyDown and KeyUp there through the writer it already has.
Motion, scroll and pads stay datagrams; an older host gets every event
as a datagram, as before.

The punktfunk-core pin moves to the commit that carries the message.
That core no longer exports reanchor::index_gap, so the four-line gap
helper lives beside its only caller now.
@enricobuehler
enricobuehler merged commit 947f1b7 into main Sep 28, 2026
7 checks passed
@enricobuehler
enricobuehler deleted the fix/key-edges-control-stream branch September 28, 2026 18:12
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