mirror of
https://github.com/efiten/coredrive-rx.git
synced 2026-12-03 17:54:09 +00:00
Two field logs traced to one root cause: config.json is fetched exactly once at
DOMContentLoaded and never retried, so a single transient failure at startup left
getConfig() returning null (or a stale cached copy) for the rest of the session.
Log A: no config at all. connectAll took its else branch, never built a Publisher,
and then reported "All connected - capturing" anyway. An hour of receptions queued
and nothing published. The Push button answered "nothing pending / not connected"
because drain() returns 0 for a null publisher exactly as it does for an empty
queue - and its reconnect branch was guarded on `publisher && !connected()`, which
skipped the one case needing recovery. The only message naming the cause went to
els('status'), which the next connect cleared with log('').
Log B: a config.json cached before rfSampler/regionDiscovery existed. Absent flags
normalize to false, so both features were dead while the served config said on -
publishing worked, everything looked green, and nothing reported it. A stale config
is worse than none: none is detectable, stale is not.
- sw.js: config.json bypasses the cache in both directions, and the
caches.match('/') fallback is limited to navigations. Serving index.html for a
JSON request is what turned an offline start into "invalid JSON: Unexpected
token '<'".
- config.js: loadConfig dedupes concurrent attempts, caches only on success so a
retry actually re-fetches, and names an HTML body instead of leaking a parse error.
- uplink.js (new, pure): uplinkState / uplinkWarning / pushOutcome /
regionInertReason / buildLogHeader.
- app.js: retries the config on every connect, on `online`, and once a minute while
missing; startPublisher() split out so a late config brings uploading up without
reconnecting; a red Home banner while receptions are buffered but not uploaded;
the progress list no longer claims an uplink it does not have; pushNow reports
queue depth independently of link health and picks the matching repair.
- Region discovery names which of its four gates is holding it, once, in the log -
"no regions lines" was consistent with all four and distinguished none. Its
re-entry throttle is now stamped before the gates instead of after.
- Every exported log carries a header with app version, EFFECTIVE config flags,
firmware version, region-discovery status, uplink state and queue depth. Both
field logs arrived unattributable to a version; the header is built at share time
so it cannot roll out of the 200-line ring buffer the way a startup line does.
Tests: 217 pass (+41). sw.js is driven in a node:vm ServiceWorkerGlobalScope so the
shipped file is tested, not a copy of its logic.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
28 lines
714 B
JSON
28 lines
714 B
JSON
{
|
|
"name": "coredrive-rx",
|
|
"version": "1.11.0",
|
|
"private": false,
|
|
"license": "GPL-3.0-or-later",
|
|
"type": "module",
|
|
"description": "Mobile RX coverage capture for CoreScope: BLE companion → MQTT (GPS + SNR/RSSI + multibyte)",
|
|
"repository": {
|
|
"type": "git",
|
|
"url": "git+https://github.com/efiten/coredrive-rx.git"
|
|
},
|
|
"homepage": "https://github.com/efiten/coredrive-rx#readme",
|
|
"bugs": "https://github.com/efiten/coredrive-rx/issues",
|
|
"scripts": {
|
|
"dev": "vite",
|
|
"build": "vite build",
|
|
"preview": "vite preview",
|
|
"test": "node --test",
|
|
"deploy": "bash deploy.sh"
|
|
},
|
|
"dependencies": {
|
|
"mqtt": "^5.10.1"
|
|
},
|
|
"devDependencies": {
|
|
"vite": "^5.4.0"
|
|
}
|
|
}
|