mirror of
https://github.com/paperclipai/paperclip.git
synced 2026-10-25 09:41:04 +01:00
A connection can drop after the database commits the outcome transaction but before the driver reports success. The retry around that transaction could not tell the two cases apart, so it could replay a committed write and create a duplicate outcome row and a duplicate publication. Give each termination a stable key from its generation number, and check for an existing row under that key before every write attempt, including a retry. The write proceeds only when the check finds none. Co-authored-by: Paperclip <noreply@paperclip.ing>