Skip to content

fix(desk): recover phone wake and unseen command receipts - #128

Merged
SSFSKIM merged 9 commits into
masterfrom
desk-m1-phone
Oct 22, 2026
Merged

SSFSKIM merged 9 commits into
masterfrom
desk-m1-phone

Conversation

@SSFSKIM

@SSFSKIM SSFSKIM commented Oct 22, 2026 •

Copy link
Copy Markdown
Owner

Why

The owner's home-screen phone app remained around sentence 426 after waking during a 1,000-sentence reply, kept /color orange queued despite its real row-confirmed outcome, then lost the receipt on reopen. The separately observed streaming-scroll problem is now tracked on its own branch/PR because it touches shared desktop virtualizer behavior.

Changes

  • Recover current state after JavaScript suspension, explicit page resume, back-forward cache restoration or coming online. A two-second wall-clock heartbeat detects suspension without mistaking buffered network frames for freshness; stale generations are fenced before close, and the new connection resnapshots. Healthy short desktop tab switches keep their socket/subscription.
  • Persist only this browser's own unseen command nonces and display metadata in localStorage (24 hours, 256 per project). Fresh pages reconcile actual hub replay without reissuing the command or drawing other browsers' stale history. A result is acknowledged only while its line is in the visible viewport.
  • Give restored nonces with no recoverable RPC/op an honest terminal outcome after a post-acceptance-window replay: Command outcome unavailable · may not have run; check the session. A bounded visible-only rejoin observes fresh restored batches without re-executing commands; live RPCs and real op receipts always win.
  • Record wake detection's accepted tradeoff: Chrome's intensive timer throttling after roughly five quiet hidden minutes can cause one reconnect on return, even with a healthy socket.

Verification

  • Focused socket, pending-ownership, composer, connection lifecycle and ProjectClient tests pass, including real socket delivery before visibility and heartbeat-first ordering after a wall-clock suspension.
  • Final wake/receipt browser file: 8/8 in Chromium and WebKit on the restored master transcript, including offline wake, killed/reopened unseen outcomes, killed-before-refusal fallback, and restored aged queued start followed by the real producer's live terminal end. Uses 1,000 numbered Markdown sentences and the exact Ran · Session color set to: orange · confirmed by its row receipt.
  • Wake recovery remains bounded against fresh reopen in each engine; this is fake-machine browser evidence, not deployed-phone latency. Composer 24/24 and pending ownership 4/4 focused unit tests pass.
  • Initial head passed static and all unit shards; browser gates exposed two elapsed-time fixture mismatches (corrected with active timer advancement) and three scroll regressions (that entire change is now split out). Final committed-head gates all pass on fc5697e51721798dc5f75828201f657e60118784: static, all four unit shards, and e2e:desk-web. Green run 39873504020. The coordinator owns e2e:desk-web-hub and independent review.

CDP frozen→active did not resume even a trivial empty page in the installed headless system Chrome. That unusable harness result supplies no app evidence; it is logged in MAWS #92. Browser proof uses the authorized offline transport path, with wall-clock/iOS buffered-frame ordering tested separately. The physical iPhone lock/unlock re-check remains for the owner's post-deploy walk. Scroll/momentum acceptance belongs to the separate transcript change, not this PR.

Separate latency observation: a synchronous post-join burst of 574 live chunks delayed receipt visibility past five seconds in both engines. Initial snapshots aggregate prior chunks on both real and fake paths; however, the real plane can accumulate and individually drain post-snapshot deltas too. This is not dismissed as fake-only exposure or claimed as a production measurement. The Decision Log records the follow-up; the receipt test isolates a restored start followed by live terminal events.

No sminos change, merge, deployment, or real-hub call.

Sminos-Session: desk-sminos-orchestrator#b4948247 (doperpowers on macbook)

Sminos-Session: desk-sminos-orchestrator#b4948247 (doperpowers on macbook)
Detect suspended JavaScript by wall clock rather than buffered frame freshness. Fence stale socket generations, resnapshot on wake, and preserve healthy short tab switches. Persist only browser-owned unseen command nonces and reconcile real hub outcomes after a fresh page.

Sminos-Session: desk-sminos-orchestrator#b4948247 (doperpowers on macbook)
Keep the snapshot-delay tests active while time advances; fastForward models JavaScript suspension and correctly triggers the new wake reconnect.

Sminos-Session: desk-sminos-orchestrator#b4948247 (doperpowers on macbook)
After RPC freshness expires, use a completed join replay to distinguish recovered command ops from missing outcomes. Show an honest terminal fallback for unseen browser ownership without re-executing; preserve live RPCs, queued starts, and late real ends.

Sminos-Session: desk-sminos-orchestrator#b4948247 (doperpowers on macbook)
Deduplicate each connection's recovered nonces by the newest saved timestamp covered, instead of a page-global boolean. Later recovered batches and other projects still get a visible post-freshness replay without periodic polling.

Sminos-Session: desk-sminos-orchestrator#b4948247 (doperpowers on macbook)
@SSFSKIM SSFSKIM changed the title fix(desk): recover phone wake, command receipts, and streaming scroll fix(desk): recover phone wake and unseen command receipts Oct 22, 2026
Restore the three transcript paths to master. Preserve the ongoing scroll work on desk-transcript-free-scroll for separate review and desktop verification; keep wake, unseen receipts, and active-timer fixture changes in this PR.

Sminos-Session: desk-sminos-orchestrator#b4948247 (doperpowers on macbook)
Distinguish waiting for the newest nonce's freshness bound from waiting for page visibility, so the grace regression proves both constraints independently.

Sminos-Session: desk-sminos-orchestrator#b4948247 (doperpowers on macbook)
Record aggregate snapshot behavior in real and fake producers and the separate post-snapshot delta burst exposure without claiming production latency from the synthetic fixture.

Sminos-Session: desk-sminos-orchestrator#b4948247 (doperpowers on macbook)
Reset fake subscription generation after closing the original page. Pause the reopened-start case at the last chunk before turn-end, then verify the real terminal row and command end arrive live without an unrelated bulk-stream workload.

Sminos-Session: desk-sminos-orchestrator#b4948247 (doperpowers on macbook)
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