feat(revyl): set device settings and keep idle sessions alive
Merged
KA
9d ago+674+674+012345678901234567890123456789-38-38-01234567890123456789
Summary
Three changes to the Revyl plugin, one commit each:
- Device settings and orientation (
db1110c).settingsnow 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-libraryis sent asmedialibrary).location-always,contacts-limitedand--modeare 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'slandscape. - Location
on/offand the other sides on iOS fail withUNSUPPORTED_OPERATIONinstead of reporting success. The capability matrix andwebsite/docs/docs/revyl.mdare updated to match.
- appearance
- 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 isunrefed, 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 theworker-connectionread ended a device start, and one oninstall_statusended an install the worker was still running. Neither read changes anything:- the readiness loop treats a 5xx on
worker-connectionas "not ready yet" and keeps polling within its deadline; install_statusreplays a 500, ashierarchyalready does.- Other statuses, such as a 403, still fail at once.
- the readiness loop treats a 5xx on
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.
- appearance, all four Android orientations, iOS landscape-left (screenshot confirmed),
- 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.
- Pixel 7: location permission, dark/light, all four orientations,
- 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](https://pr-comments-assets.blacksmith.sh/codesmith/autofix-with-codesmith-dark-3x.png)
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.