fix(android): refresh the phone's own row when it reports

The fleet card reads last-seen from the claw, and only a landed report
moves it. Periodic work is deferred while the device idles — Doze
stretches the fifteen-minute floor to hours — so a phone sitting in the
human's hand could show itself as "last seen 3h ago" with nothing wrong
on the claw.

Kick a status run on resume, the same way the commands worker already
is, and reload the fleet whenever a run lands. The landed-run signal is
a new clock in StatusRepository, written in the same edit that saves the
snapshot (which only happens once every post of the run succeeded), so
the card reloads on a report that actually reached the claw.
This commit is contained in:
vhaudiquet committed 2026-10-20 07:40:43 +02:00
1 parent 4a91635730
commit 385788c935
4 files changed
+39 -5

No files matched your search

+10 -1
View File
@@ -95,7 +95,16 @@ manages the device fleet the claw keeps.
it is. The heartbeat exists for the fleet's last-seen time: the claw
stamps a device "seen" on whatever post lands, so a run with no
transitions posts one anyway and the row stays fresh at the worker's
cadence instead of the last flip.
cadence instead of the last flip. A failed post ends the run anyway —
the snapshot is only saved when every post landed, so the next
scheduled run re-derives the whole transition set; `retry()` would
hand the cadence to WorkManager's exponential backoff (hours) and the
phone would read as gone. And because idle devices defer periodic work
(Doze stretches the fifteen-minute floor to hours), the app kicks a
status run on every foreground: a phone in hand reports then and
there, and the fleet card reloads on each landed run (`lastReportAt`)
so its own row reads from the new clock instead of the one it was
opened at.
Every report is an observation on the claw: it lands in the phone
tables (the ingest answers `{"ingested": "observed"}`) and a `phone`