docs(sfm): state the held-line invariant, pin the hang-up on a library error, correct the README
- Series4Session's docstring now states which errors keep the line: an op raises a DeviceError only for a verdict on a healthy link (not found, stale, unnameable), and _exchange keeps the line for those; any library error means the link is suspect and hangs up. DecodeMismatch is a library error and hangs up -- conservative. Later ops must keep to it. - Test: a micromate TimeoutError mid-download, on a fresh DeviceAccess (no retry path), is NoAnswer, closes the client once and leaves no held line. It pins existing behaviour; a mutation that keeps the line on library errors makes it fail. - README, event rows corrected in place: another unit's id is 422 (not 409); a stale id is 409 without downloading, both series; an event already stored -- including by THOR's watcher -- returns its row and changes nothing (detail.already_stored); MiniMate lists give record_type null, on the normal timeout, and fail on a lost reply. No code behaviour change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44
This commit is contained in:
1 parent
4e1e6a9d5c
commit
2a70faf7b5
3 files changed
+27
-2
No files matched your search
@@ -179,8 +179,8 @@ via a thread-safe `_LiveCache` (plain Python dict + `threading.Lock`):
|
||||
| `POST` | `/device/call_home` | Reads, patches specified fields, writes back to device |
|
||||
| `GET` | `/device/settings` | Recording settings in the shared model, either series; serial required; never cached |
|
||||
| `POST` | `/device/hangup` | Releases a held Series-4 line now; `{"hung_up": bool}` |
|
||||
| `GET` | `/device/events?serial=` | Lists a unit's events, either series, each with an opaque `event_id` (`serial:key:timestamp`). A MiniMate list reads headers only (no bulk download) |
|
||||
| `POST` | `/device/events/download?serial=&event_id=` | Downloads one event, checks it, and stores it in SFM's database; returns `db_event_id` (file at `GET /db/events/{db_event_id}/blastware_file`). A stale `event_id` (unit erased or wrapped since the list) or one from another unit gets **409**, with no download. Re-downloading refreshes the stored row (same `db_event_id`, `inserted: false`). The unit is busy for the whole download; other requests to it get 423 |
|
||||
| `GET` | `/device/events?serial=` | Lists a unit's events, either series, each with an opaque `event_id` (`serial:key:timestamp`). A MiniMate list reads headers only (no bulk download), on the normal timeout, and gives `record_type: null` (its event record does not say waveform or histogram; not decoded yet). A lost reply fails the list rather than shortening it |
|
||||
| `POST` | `/device/events/download?serial=&event_id=` | Downloads one event, checks it, and stores it in SFM's database; returns `db_event_id` (file at `GET /db/events/{db_event_id}/blastware_file`). A stale `event_id` (unit erased or wrapped since the list) gets **409** without downloading, for both series; an `event_id` from another unit gets **422**, before any I/O. An event already stored — by an earlier download, or by THOR's watcher — returns its existing row and changes nothing (same `db_event_id`, `inserted: false`, `detail.already_stored: true`). The unit is busy for the whole download; other requests to it get 423 |
|
||||
|
||||
**Cache bypass** — All cached endpoints accept `?force=true` to skip the cache and
|
||||
force a fresh read from the device.
|
||||
|
||||
Reference in new issue
Block a user