Skip to content

Validation failed: Synced has already been taken #79

@thilonel

Description

@thilonel

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions