heikkilevanto / beertracker

Simple script to track the beers I drink
GNU General Public License v2.0
2 stars 1 forks source link

Double submit #226

Closed heikkilevanto closed 2 years ago

heikkilevanto commented 2 years ago

Looks like I managed to double click two beers today. And when I deleted one of them, the other disappeared too.

I think they both got the same timestamp.

So, when adding a beer, check if we already have that timestamp, and refuse to add one more.

heikkilevanto commented 2 years ago

Yes, I can see the deleted records have the same timestamp.

At least I can modify the deleting loop so that it will only delete one beer, so we don't do the double-delete. Would not have helped in this case, as the correct beer was the first one.

Managed to reproduce it. Added a check against last seen timestamp, and if a match, increment the seconds and write a warning on stderr (error.log)