Closed nwalters512 closed 5 years ago
This pull request is automatically deployed with Now. To access deployments, click Details below or on the icon next to each push.
Yep, good call!
Would also be nice to contribute these changes back to sequelize-stream
someday, but I don't think I have the bandwidth to do that now.
As noted in the Sequelize docs, Sequelize uses a transaction internally for operations like
findOrCreate
, which is precisely the method that the active staff API uses when adding staff members. I believe this fact is causing #92 - there's a race condition where we try to read a tuple before the transaction that creates it has been committed. This PR modifies the code fromsequelize-stream
to make theoptions
object available to event listeners so that we can useoptions.transaction
as appropriate.Closes #92 (just over a year after it was reported!)