A device reconnects and sends its backlog twice
MQTT QoS 1 promises at-least-once delivery, not exactly-once. If the acknowledgement is lost while the link drops, the device resends the same reading after it reconnects. Without a message id and a dedupe on the cloud side, both copies are stored and the chart doubles.
also: a whole fleet reconnecting in the same second after an outageawait device.publish(reading(412), { qos: 1 }) broker.dropAck(412); await device.offline('24h') await device.online(); await cloud.drain() expect(db.count('readings', { msgId: 412 })).toBe(1) // got 2 expect(chart.total('24h')).toBe(sum(device.log())) // got sum + reading 412


