-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Labels
Description
This is the error we can see quite often:
ActiveRecord::RecordInvalid: Validation failed: Synced has already been taken
I think happens, when there's a new object and two jobs are running in parallel:
The first job creates the booking, the second one tries to create the booking as well, and fails with this error.
This is the variable that does not reflect the DB state:
https://github.com/BookingSync/synced/blob/master/lib/synced/strategies/full.rb#L99
Retrying to save this batch should solve the problem, so that https://github.com/BookingSync/synced/blob/master/lib/synced/strategies/full.rb#L108
won't create a new object, but update the existing one.
WDYT?