Andrey Epifancev 972976b16a fix(core): claimAll reclaims own work; isolate per-record queue errors
- I-1 (F-1): claimAll() now also moves this device's own `retry` records
  and own stale `sent` records to `saved` via the `claim` transition
  (device = own), same as it already does for other devices' claimable
  records, then runs a normal tick() so everything sends without waiting
  for the next retry time. The returned count still only reflects records
  reassigned from other devices. Adds `ownReclaimable()` to schedule.ts.
- M-1 (F-2): pass() wraps each per-record operation (staleOwn update and
  each send) in try/catch, remembers the first error, keeps processing the
  rest of the due queue, and rethrows the first error after both loops
  complete — so one permanently failing record no longer blocks newer
  records behind it. list()/load() failures still reject tick()
  immediately, as before.
- F-4a: send()'s post-request update now also requires
  `r.device === env.deviceId && r.sentAt === sent.sentAt`, so a late
  transcription result can never overwrite a record another device (or a
  newer send) has since taken over.
- F-4b: pass()'s staleOwn loop now also stops when the abort signal fires;
  retry() and claimAll() return early (false / 0) without writing once
  disposed.
- F-4d: retry() no-op it.each now also covers `sent` (own, fresh).

Refs #1

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-27 17:12:31 +04:00
..