Sensor Batch Deduplication Keeps the Oldest Reading
Level 2 · node · Data · Incorrect latest-reading selection
Scenario
A factory sensor gateway ingests batches containing repeated measurements for the same sensor. It must retain the latest reading, but the batch processor currently keeps the first measurement, leaving dashboards with stale values.
Requirements
Retain the greatest timestamp for each sensor. Return one reading per sensor, preserve unrelated sensors, and return an empty result for an empty batch.
Acceptance criteria
- The newest timestamp wins for a repeated sensor
- Each sensor appears exactly once
- Different sensors remain in the output
- An empty input returns an empty list