julian 0fcc6f179b note: Phase 1.5 IMEI/UUID fix + Phase 2 cold-load fix + positions decision
Three log entries plus matching wiki updates from yesterday and today's
work:

[2026-05-03] Phase 1.5 live broadcast fix (yesterday). snapshot.ts and
device-event-map.ts joined positions.device_id (text/IMEI) directly
against entry_devices.device_id (uuid). Subscribe returned an empty
snapshot (Postgres 42883), and device-event-map cache misses meant the
streaming path classified every record as orphan. Fixed in processor
f2c64a2: both queries hop through the devices table. Embedded lesson:
integration test fixtures must mirror production join shapes — the
existing fixture had entry_devices.device_id text, masking the prod
type mismatch.

[2026-05-04 morning] Positions-as-collection abandoned. Pushed
db-init/004 (PRIMARY KEY device_id, ts) and the always-re-apply runner;
boot logs confirmed re-apply 001/002/003, apply 004. But Directus still
emits "Collection 'positions' doesn't have a primary key column":
Directus introspection requires a SINGLE-column PK, and TimescaleDB
requires the partition column in every unique index — these constraints
are mutually exclusive on the positions hypertable. Operator faulty-flag
UI re-scoped to a custom Directus endpoint extension, deferred until
after Rally Albania 2026-06-06. Migration 004 left in place (harmless,
redundant with positions_device_ts).

[2026-05-04 afternoon] Phase 2 cold-load truly works. Three independent
lifecycle bugs in spa/src/map/core (committed separately in trm/spa,
8859c95): Map.loaded() deadlock on styles without `sprite`; styledata
cascade triggered by installSprites' addImage calls (87k events in 28s);
BasemapSwitcher remount cycle re-firing setBasemap on every gate cycle.
Verified end-to-end via Playwright on a local backends-only stack
(trm/deploy/compose.local.yaml, e9592cd). Resolves the "SPA Phase 2 is
the biggest fish" debt — Phase 3 dogfood readiness is next.

Wiki updates:
- position-record.md: §"device_id is the IMEI — not the business
  devices.id" capturing the storage shape and join chain through devices
- processor-ws-contract.md: corrected deviceId field semantics (Phase 1
  ships IMEI text on the wire, not devices.id uuid as originally
  spec'd); flagged as documented divergence; added Server-side data
  resolution section with the snapshot + device-event-map SQL
- directus-schema-draft.md §"Position flagging": full architectural
  decision record for the custom-endpoint approach, replacing the
  earlier "exposed as a Directus collection" plan
2026-05-04 14:19:04 +02:00
2026-04-30 12:29:55 +02:00
S
Description
No description provided
Readme 764 KiB
Languages
Markdown 100%