Skip to content

[Bug]: Mobile browser screencast leaves a "Capturing" display-sleep assertion held for hours, so the Mac never sleeps its display or locks #24946

Closed

Description

@hisgarden

Operating system

macOS

Orca version

1.4.218

Details

Summary

Two browser tabs on desktop Orca held a NoDisplaySleepAssertion "Capturing" for about 13 hours 50 minutes. While they were held, macOS never turned the display off, and because screen lock is tied to display sleep, the Mac never locked. The assertions were released only when I quit Orca.

The likely cause is a screencast subscription from the mobile app that was never released: a static page never trips the ghost-subscriber eviction, and over the relay there is no liveness check on phone data connections. The same code is still on main at b032867021.

Environment

  • Orca desktop 1.4.218, official notarized build (Electron 43.7.5, Chrome 150.0.7871.250)
  • macOS 27 (Darwin 27.0.0), Apple Silicon MacBook, built-in display
  • One paired device: Orca mobile app (version not recorded), with a relay binding, connection mode "automatic"
  • macOS settings: display sleep 2 min, require password 5 min after display off

What happened

  1. 07:14 — a browser tab was opened in a worktree (a claude.ai page showing a sign-in screen).

  2. 07:19:15 — Orca created a NoDisplaySleepAssertion "Capturing".

  3. 07:20:54 — a second browser tab was opened on the same URL; a second "Capturing" assertion was created the same second.

  4. 07:21:29 — a third tab was opened; its assertion was created and released within one second (the expected behaviour).

  5. The first two assertions were never released. At 21:07 pmset -g assertions still showed:

    pid 13101(Orca): [0x0000910d000593f6] 13:46:27 NoDisplaySleepAssertion named: "Capturing"
    pid 13101(Orca): [0x000090a9000593d6] 13:48:06 NoDisplaySleepAssertion named: "Capturing"
    

    and pmset -g reported displaysleep 2 (display sleep prevented by Orca, Orca).

  6. The display last turned on at 09:03 and did not turn off again all day.

  7. After quitting Orca, pmset -g assertions | grep -c Capturing returned 0 and display sleep was no longer blocked.

I did not start any capture or recording myself. The mobile app was open on these browser tabs around 07:19–07:21, with the phone on the same Wi-Fi as the Mac. I do not know whether that session used the direct socket or the relay.

Expected

A browser-tab stream to a remote viewer should not block display sleep and screen lock on the host indefinitely. The stream, and the assertion with it, should end when the viewer stops watching, is suspended, or has been unreachable for a bounded time.

Likely cause (from reading the code; not confirmed at runtime)

Checked against the 1.4.218 bundle and main at b032867021. The last change to the host screencast files is from Sep 20, so both match.

  1. The wake lock comes from the screencast. The only path to Page.startScreencast is the browser.screencast RPC (src/main/browser/browser-screencast-stream.ts). Chromium holds the "Capturing" wake lock for as long as the CDP screencast runs, and nothing in src/main releases or avoids it.
  2. The screencast runs until the last subscriber leaves. That needs an explicit unsubscribe, a connection close, or the ghost-subscriber eviction.
  3. The eviction never fires on a static page. browser-screencast-ghost-subscriber-eviction.ts evicts after 90 consecutive refused frames, and its own comment says "an idle page costs nothing and never evicts". A sign-in page produces almost no frames.
  4. The direct transport reaps dead phones; the relay path does not.
    • src/main/runtime/rpc/ws-transport.ts runs a 15 s ping/pong sweep (RemoteRuntimeServerHeartbeat) because "mobile clients background-suspend sockets with no TCP FIN".
    • src/main/runtime/rpc/relay-transport.ts has no ping or heartbeat on per-phone data sockets; that heartbeat class is used only by the direct transport.
    • On the relay server, host-session-registry.ts pings only the desktop control socket (15 s ping, 75 s silence). The phone-to-host pipe in splice-forwarder.ts closes only when one of the two sockets emits close.
    • idleTimeoutMs (10 min) is defined in cloud/packages/relay-contract/src/protocol-limits.ts but is not referenced outside tests.

Putting these together: if the phone is suspended before its unsubscribe is sent and the socket goes half-open, nothing on the relay path notices. The subscription, the screencast and the wake lock then persist until Orca quits.

Open question: the phone was on the same Wi-Fi, so the session may have used the direct socket, where the 15 s heartbeat should have reaped a dead phone within about a minute. If it did use the direct socket, the relay gap in point 4 does not explain this case and there is another path that leaves a screencast subscription registered after its client is gone. I could not tell which, because the trace and daemon logs do not record screencast subscribe or unsubscribe events or the transport used.

Impact

  • Security: the Mac stays unlocked and the display stays on while unattended, with nothing in the desktop UI that I noticed showing that a tab is being streamed.
  • Battery: the display stayed on for about 12 hours.

Suggestions

  • Apply the same ping/pong reaping to relay data connections as the direct transport has, or enforce the relay's idleTimeoutMs.
  • Give screencast subscribers a time-based liveness check, so a static page cannot keep a ghost subscriber forever.
  • Consider running the screencast without the display wake lock, or releasing it when the host is idle.
  • Show an indicator on the desktop tab while it is being streamed.
  • Log browser.screencast subscribe and unsubscribe events with the client kind and transport.

Related

Workaround

Close the affected browser tabs or quit Orca, then verify with pmset -g assertions | grep Capturing.

Activity

  1. added
    os:macos
    on Oct 3, 2026
  2. self-assigned this
    on Oct 27, 2026
  3. added a commit that references this issue on Nov 10, 2026
    6843d8f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

browsermobileos:macos

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions