meri-imperiumi / signalk-logbook

Semi-automatic electronic logbook for sailing vessels running Signal K
11 stars 5 forks source link

Automatic entries can cause data loss #58

Open bergie opened 1 week ago

bergie commented 1 week ago

Very rare occurrence, but I've seen this now happen twice (in some 7k miles logged with logbook) where an automatic entry made into a day can somehow lose all previous entries from the day.

Here's an example of this happening (via a sail change log entry): https://github.com/meri-imperiumi/log/commit/af17576ebd60f5c972c030a9c43b1a78e0aaaef5

bergie commented 1 week ago

It is almost certainly caused in https://github.com/meri-imperiumi/signalk-logbook/blob/main/plugin/Log.js#L125

return this.getDate(date).catch(() => []);

As to why we get an error when reading the stored entry, no idea.