ioBroker / ioBroker.influxdb

Store history data in InfluxDB (not for Windows)
MIT License
36 stars 25 forks source link

Possible data loss when updating values via GUI #333

Open Marc-Berg opened 1 year ago

Marc-Berg commented 1 year ago

Describe the bug
If you want to edit data via the GUI and accidentally enter a text instead of "Number", the record will be deleted but not recreated.

To Reproduce
Steps to reproduce the behavior:

  1. Select a Datapoint with Datatype "Number"
  2. Go to 'History Data'
  3. Select a line
  4. Click on 'Update'-Button
  5. Enter a text like "abcd" or leave empty
  6. Click "Update"

Expected behavior
A suitable error message that the data type is not correct or no action.

Versions:

Additional context
You can see in the source code that the variable "state.val" remains empty. This causes the function "pushValueIntoDB" to be aborted. The callback is not evaluated, so the failed update is not noticed. Since the Delete function was called before the call of "pushValueIntoDB", data is lost.

Since I have just implemented the Update/Delete function for InfluxDB 2.x, a comprehensive solution for 1.x and 2.x would be useful.

Edit: Changes to the wording