Skip to content

fix(desktop): allow WebKitGTK media permission requests so huddles work on Linux#2481

Open
ryanrhughes wants to merge 1 commit into
block:mainfrom
ryanrhughes:ryan/linux-huddle-media-permissions
Open

fix(desktop): allow WebKitGTK media permission requests so huddles work on Linux#2481
ryanrhughes wants to merge 1 commit into
block:mainfrom
ryanrhughes:ryan/linux-huddle-media-permissions

Conversation

@ryanrhughes

Copy link
Copy Markdown

Problem

Huddles have never worked on the Linux desktop app: starting one tears itself down about a second later. The mic never connects.

Root cause: WebKitGTK denies any permission request the embedder doesn't handle, and wry's WebKitGTK backend registers no permission-request handler (it implements media permissions only on Android and macOS — verified against wry 0.55.1 sources). So getUserMedia() always rejects on Linux → connectAndSetupMedia throws → cleanupFailedStart() ends the huddle. The open dictation PR (#1511) adds UI copy for "mic permission denied" — that's this bug's symptom.

Implementation

A small linux-media-permissions plugin in desktop/src-tauri/src/lib.rs: on webview ready, reach the native webkit2gtk::WebView via with_webview and connect permission-request, allowing exactly two request types:

  • UserMediaPermissionRequest — mic/camera capture (huddles)
  • DeviceInfoPermissionRequest — device labels for the input picker

Everything else returns false, keeping WebKitGTK's default deny — nothing beyond media devices is granted. Compiled out entirely on macOS/Windows.

Cargo.toml adds a Linux-only webkit2gtk = "2.0" dependency — the same crate + version Tauri already links (2.0.2 in the lockfile), needed only to name the types.

Testing

An automated test is impractical here: the behavior lives in a native WebKitGTK signal handler that requires a live webview under a compositor. Verified manually on Arch Linux (Hyprland/Wayland, webkit2gtk-4.1 2.52.4):

  • Before: start huddle → mic never connects → huddle drops after ~1s, every time.
  • After: start huddle → mic connects, huddle stays up, audio works.

Manual test steps: on any Linux machine, build the desktop app, join a community, start a huddle in a channel. Without this patch it self-ends within ~2s; with it, it stays connected.

Checklist

  • just ci: all gates pass except buzz-db unit test replica_fence::tests::fence_starts_closed_and_opens_on_advance, which fails identically on pristine main (timestamp precision mismatch: …237894Z vs …237894147Z, last touched in Route lag-tolerant reads to an optional Postgres read replica #2084) — pre-existing and unrelated; happy to file a separate issue.
  • Integration tests: N/A — no relay/db/auth changes.
  • No new unwrap()/expect() in production paths; no unsafe.
  • No new public API surface to document; behavior is documented in code comments.

@ryanrhughes
ryanrhughes requested a review from a team as a code owner July 23, 2026 06:45
…rk on Linux

WebKitGTK denies any permission request the embedder doesn't handle, and
wry's WebKitGTK backend registers no permission-request handler (it only
implements media permissions on Android and macOS). getUserMedia() has
therefore always rejected on Linux: the huddle mic never connects,
connectAndSetupMedia throws, and cleanupFailedStart tears the huddle down
about a second after it starts.

Connect the permission-request signal on webview ready and allow
UserMediaPermissionRequest (mic/camera) and DeviceInfoPermissionRequest
(device labels for the picker). Every other request type falls through to
the default deny, so nothing is granted beyond media devices. No-op on
macOS/Windows.

Verified on Arch Linux (Hyprland/Wayland, webkit2gtk-4.1 2.52.4): huddles
previously dropped ~1s after starting; with this change the mic connects
and the huddle stays up.

Signed-off-by: Ryan Hughes <ryan@heyoodle.com>
@ryanrhughes
ryanrhughes force-pushed the ryan/linux-huddle-media-permissions branch from fa477aa to 4b505a6 Compare July 23, 2026 06:52
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