coorasse / passkit

Wallet Pass generation for Ruby On Rails
MIT License
90 stars 27 forks source link

Do not register the same device+push token #8

Closed coorasse closed 7 months ago

coorasse commented 1 year ago

See also #6 . It's possible that parallel duplicate requests are sent to register a device. We should introduce a validation for uniqueness on the model and a unique index on the database level. Still, due to race conditions, the validation will fail and an hard database error will be triggered. If this happens, we will consider the registration successful and return a 200.