noi-techpark / bdp-core

Open Data Hub / Timeseries Core
https://opendatahub.com
Other
9 stars 4 forks source link

When checking if a data point is older than the most recent one, period is not considered correctly #278

Open clezag opened 7 months ago

clezag commented 7 months ago

When data is pushed, the writer checks if any of the records are older than the most recent record in the database. If they are, they are silently discarded. During a code review, it has become apparent, that when loading the "most recent record", the period used is always simply the first one encountered in the data push. Meaning that if you push data with heterogeneous periods, you could have some of your records discarded without feedback.

To amend this, a "most recent record" should be retrieved for each period encountered, and the check should always be made against the most recent record matching a data point's period.

For reference: MeasurementAbstractHistory:java: 150ff