fix(mobile): share pending screen recording stops with cleanup
Merged
SH
17d ago+107+107+012345678901234567890123456789-6-6-0123456789
- 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.
| Case | main e99a6fa | this branch |
|---|---|---|
| SDK stop commands in the built CLI | 2 | 1 |
| Ending the attempt | CLEANUP_TIMEOUT | completes |
| Original stop-wait timeout and exit 3 | retained | retained |
| Deterministic cancelled waiter + concurrent caller + cleanup | 3 SDK stops, fails | 1 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.