Repository navigation
Description
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
-
07:14 — a browser tab was opened in a worktree (a claude.ai page showing a sign-in screen).
-
07:19:15 — Orca created a
NoDisplaySleepAssertion "Capturing". -
07:20:54 — a second browser tab was opened on the same URL; a second "Capturing" assertion was created the same second.
-
07:21:29 — a third tab was opened; its assertion was created and released within one second (the expected behaviour).
-
The first two assertions were never released. At 21:07
pmset -g assertionsstill showed:pid 13101(Orca): [0x0000910d000593f6] 13:46:27 NoDisplaySleepAssertion named: "Capturing" pid 13101(Orca): [0x000090a9000593d6] 13:48:06 NoDisplaySleepAssertion named: "Capturing"and
pmset -greporteddisplaysleep 2 (display sleep prevented by Orca, Orca). -
The display last turned on at 09:03 and did not turn off again all day.
-
After quitting Orca,
pmset -g assertions | grep -c Capturingreturned 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.
- The wake lock comes from the screencast. The only path to
Page.startScreencastis thebrowser.screencastRPC (src/main/browser/browser-screencast-stream.ts). Chromium holds the "Capturing" wake lock for as long as the CDP screencast runs, and nothing insrc/mainreleases or avoids it. - The screencast runs until the last subscriber leaves. That needs an explicit unsubscribe, a connection close, or the ghost-subscriber eviction.
- The eviction never fires on a static page.
browser-screencast-ghost-subscriber-eviction.tsevicts 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. - The direct transport reaps dead phones; the relay path does not.
src/main/runtime/rpc/ws-transport.tsruns a 15 s ping/pong sweep (RemoteRuntimeServerHeartbeat) because "mobile clients background-suspend sockets with no TCP FIN".src/main/runtime/rpc/relay-transport.tshas 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.tspings only the desktop control socket (15 s ping, 75 s silence). The phone-to-host pipe insplice-forwarder.tscloses only when one of the two sockets emitsclose. idleTimeoutMs(10 min) is defined incloud/packages/relay-contract/src/protocol-limits.tsbut 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.screencastsubscribe and unsubscribe events with the client kind and transport.
Related
- [Bug]: Mobile/remote browser screencast stops when host display turns off #11492 (open) — "Mobile/remote browser screencast stops when host display turns off". The inverse problem: it asks for the display to stay awake while a stream is live. This report does not dispute that; it is about a stream that never ends, so the display block never ends either. Any fix there that holds the display for active
browser.screencastsessions would make this leak matter more. - [Bug]: "Keep computer awake" also blocks display sleep — the screen never turns off, unlike caffeinate #17078 (open) — "Keep computer awake also blocks display sleep". Same symptom from a different feature. This report is not a duplicate: the assertion here is Chromium's
NoDisplaySleepAssertion "Capturing"from the screencast, not the keep-awakepowerSaveBlocker. - Unify the keepalive / dead-link policy across the four transports that reinvent it #17823 (closed, unresolved) — keepalive and dead-link policy across transports. Its relay reaper (PR fix(ssh): declare a wedged relay link lost, and stop reading silence as a verdict #17817) covers the SSH relay, not mobile data connections through the cloud relay.
Workaround
Close the affected browser tabs or quit Orca, then verify with pmset -g assertions | grep Capturing.
Activity
fix(browser): stop a stalled tab capture keeping the Mac's display aw…