feat(revyl): set device settings and keep idle sessions alive

Merged
KA
9d ago
+674-38

Summary

Three changes to the Revyl plugin, one commit each:

  • Device settings and orientation (db1110c). settings now drives Revyl's worker actions instead of refusing:
    • appearance light / dark / toggle (toggle reads the current appearance first)
    • location set <lat> <lon>
    • permissions through /set_permissions, using Maestro's names (media-library is sent as medialibrary). location-always, contacts-limited and --mode are refused, because the worker has no equivalent.
    • clear app state, and reset keychain on iOS.
    • Orientation takes all four sides on workers that report supports_precise_orientation (Android). On iOS it takes portrait and landscape-left only; landscape-left maps to the worker's landscape.
    • Location on / off and the other sides on iOS fail with UNSUPPORTED_OPERATION instead of reporting success. The capability matrix and website/docs/docs/revyl.md are updated to match.
  • Session keep-alive (1aed016). A connected session reads the worker's appearance once a minute, which marks the worker active, so a pause between commands no longer ends the session. Sessions now ask for a 5-minute idle timeout instead of 30, so a device left behind by a process that exits without disconnecting is released sooner. The timer is unrefed, skips a beat while a read is in flight, and is cleared before /stop.
  • Server errors on status reads (d98560f). A single 500 from Revyl on the worker-connection read ended a device start, and one on install_status ended an install the worker was still running. Neither read changes anything:
    • the readiness loop treats a 5xx on worker-connection as "not ready yet" and keeps polling within its deadline;
    • install_status replays a 500, as hierarchy already does.
    • Other statuses, such as a 403, still fail at once.

Validation

  • Live, on Revyl's production Android emulators and iOS simulators, through the JS client:
    • appearance, all four Android orientations, iOS landscape-left (screenshot confirmed), location set, permissions, clear-app-state and reset-keychain;
    • the refusals named above.
  • Live through e2e's mobile engine with this build linked in, both passing:
    • Pixel 7: location permission, dark/light, all four orientations, setLocation;
    • iPhone 16: photos permission, dark/light, landscape-left, setLocation, clearKeychain.
  • Keep-alive: an Android session held with no commands for 7 minutes, past the 5-minute idle timeout, still answered a screenshot, then released.
  • Server errors: the two 500s were seen on live runs. New tests (runtime-transient-reads.test.ts, revyl-client.test.ts) fail without the fix.
  • pnpm check:quick, pnpm check:capabilities-matrix, pnpm check:doc-prose, and the provider-revyl unit project pass.

Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.