mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-09 13:01:00 +00:00
The workout-slot detection reads the best workout and writes its record inside one transaction under a per-user advisory lock, and the workout DELETE takes the same lock before removing records and the workout. A delete can no longer land between the read and the write and leave a record for a workout that is gone. The DELETE's match for a legacy record without an external id is scoped to the slots of the deleted workout's sport, so a record another sport set at the same instant stays.