No description
Find a file
jtricerolph 59a3e091d8 Fix MHI room-temp race: serialize per-unit DB writes
handleMhiStatus() rewrites the whole cached row from an in-memory cumulative
state object on every single signal message, via an unawaited pool.query()
per message. When several retained signals for the same unit arrive in a
tight burst (e.g. right after a broker reconnect), their DB writes can
complete out of dispatch order — an older write, captured before a later
tempAmbientSts update was known, could land in Postgres AFTER a newer write
that already had the correct room temp, silently reverting it to stale/null.

User reported AC room temp "randomly" missing from the dashboard while the
correct value was visible in the broker's retained topic — exactly this
symptom, not an MQTT delivery gap.

Fixed by chaining each unit's writes through a per-externalRef promise queue
(mhiWriteChain) so completion order can never diverge from dispatch order.
state is read at actual write time, not snapshotted early, so a queued write
still picks up whatever's freshest by the time its turn comes up.
2026-08-25 14:34:42 +00:00
backend Fix MHI room-temp race: serialize per-unit DB writes 2026-08-25 14:34:42 +00:00
docs Add Phase 2 MHI Modbus register-map profile, xlsx importer, and a 2026-07-27 14:19:58 +00:00
frontend Add per-TRV control panel + valve/wifi telemetry, restyle dashboard radiator icon 2026-08-25 14:25:46 +00:00
.gitignore Add Phase 2 MHI Modbus register-map profile, xlsx importer, and a 2026-07-27 14:19:58 +00:00
docker-compose.yml hvac: fetch MQTT credentials from Settings (drop .env secret) 2026-08-13 13:42:58 +00:00
seed-app.js Scaffold Phase 1 hvac app — NewBook-driven room TRV heating scheduler 2026-07-26 18:00:42 +00:00