Repository navigation
Conversation
A device kept for its owner across a reboot (keepOwnership=true or --auto-restore-owner) came back as a plain reservation: the processor sent the claimed usage as the AutoGroupMessage identifier, and the device joined with no usage and the provider --group-timeout. An API reservation with usage "automation" therefore showed as Busy instead of Automated, and lost the timeout its client asked for. AutoGroupMessage now carries usage and timeout, and its identifier is empty for a restore, since no ADB or VNC authorization waits on it. Workers report the requested timeout on JoinGroupMessage, the processor stores it as ownerTimeout, and reserveDeviceOwner copies it into the claim. The iOS provider replays both as well. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Covers the processor replaying a claim as AutoGroupMessage, the Android and iOS workers joining with the carried usage and timeout, the claim copying the reservation timeout, and the timeout staying out of API responses. Documents that a restored reservation keeps its usage and timeout. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
✅ STF CI reportAll green · 6 test tiers (6 pass / 0 fail / 0 skip) · 20 Android versions (20 with a usable device in STF) Test tiers
Android device matrix
Image = a system image is published for that API and arch. Boot = emulator reached Logs, screenshots, logcat and Playwright traces are attached to the run as artifacts · full run · commit |
Bug
When a device is kept for its owner across a reboot (
POST /api/v1/user/devices/{serial}/reboot?keepOwnership=true, or a device that disappears while in use when the processor runs with--auto-restore-owner), it came back as a different kind of reservation than the one the owner had:restoreDeviceOwnerpassed the claimed usage as theAutoGroupMessageidentifier, and the device joined with no usage. A device reserved throughPOST /api/v1/user/devices(usageautomation) came back as a plain reservation. The device list showed Stop Using instead of Automated, admins had no Stop Automation, and the API reportedusage: null.AutoGroupMessagehad no timeout, and the claim did not store one. The restored reservation used the provider--group-timeout(900 s by default) instead of thetimeoutthe client asked for.Change
AutoGroupMessagegetsoptional string usage = 3andoptional uint32 timeout = 4. The processor fills both from the claim. The identifier is now''for a restore. The other senders put an ADB fingerprint or a VNC auth response there, andautojoinlisteners match on it. A restore has no credential, and an empty identifier never matches a pending ADB or VNC authorization.JoinGroupMessagegetsoptional uint32 timeout = 6(5 stays reserved). The Android group plugin and the iOS bridge report the timeout that was requested, not the resolved one. A reservation on the provider default therefore stays on the default after a restore.ownerTimeout.reserveDeviceOwnercopies it into the claim asrestoreOwner.timeout. Every write that clearsusage(release, ready, initial state) clears it too.datautil.normalizekeeps it out of API responses, as it already does forrestoreOwner.AutoGroupMessage. On iOS, restoringautomationturns Appium mode on again, the same as the original reservation did.doc/device-states.md: theclaimedbullet now says that the reservation comes back with its usage and timeout.All new fields are optional. Mixed versions keep working: an older worker reports no timeout, an older claim has none, and either case falls back to the provider default, as before. Lease reservations (
leaseId) are never claimed, so they are unaffected.How tested
npm run lint(0 errors, no new warnings),node build.mts typecheck,npm run test:unit(832 passing, plus the ios-prototype tests).New unit tests:
--group-timeout, and reports the requested timeout on join.automationwith its timeout and Appium mode.ownerTimeoutis written, cleared and copied into the claim.ownerTimeoutis stripped.With this branch's tests, the lib code from master fails 15 of them.
E2E, locally: an API 29 emulator,
stf local emulator-5560, RethinkDB in Docker. I reserved the device withPOST /api/v1/user/devices{"serial":"emulator-5560","timeout":180000}, calledreboot?keepOwnership=true, and waited until it was present and ready with a new reservation:{email, usage: "automation", expiresAt}{email, usage: "automation", timeout: 180000, expiresAt}usageafter the restore (API)null"automation"--group-timeout900 s)automatic_timeoutexactly 180 s after the restore (run twice: 00:26:54 → 00:29:54, 00:31:06 → 00:34:06)🤖 Generated with Claude Code