fix(mobile): share pending screen recording stops with cleanup

Merged
SH
17d ago
+107-6
  • Keep one screen-recording stop in flight across cancelled callers and attempt cleanup. A confirmed completion clears the recording; an actual SDK failure permits a later retry.
  • Preserve cancellation before dispatch, document cleanup behavior, and add the patch changeset.
flowchart LR
  A[Stop requested] --> B[Shared device stop]
  A --> C[Caller cancels its wait]
  C --> D[Attempt cleanup]
  D --> B
  B --> E[Clear recording on success]

Issue

Fixes #1558.

Verified

Ran it locally: yes, the built CLI and compiled mobile engine over a simulated SDK, with real subprocess workers. A 750 ms finalization response exceeds the caller's 500 ms cleanup budget.

Casemain e99a6fathis branch
SDK stop commands in the built CLI21
Ending the attemptCLEANUP_TIMEOUTcompletes
Original stop-wait timeout and exit 3retainedretained
Deterministic cancelled waiter + concurrent caller + cleanup3 SDK stops, fails1 SDK stop, passes
main:        stopping the video timed out; ending the attempt timed out
this branch: stopping the video timed out
  • Cancellation and actual-stop-failure retry cases pass, including cleanup entering between SDK rejection and adapter state updates. Mobile build/typecheck, repository lint, and all 494 mobile unit tests pass. The public reproduction commands are in #1558.
  • The full local workspace gate has not completed. Dead-code checking on the partial workspace install reports identical findings on main and this branch.
  • Simulator benchmarks, native daemon behavior, and actual media were not exercised. The simulated SDK establishes adapter lifecycle behavior.