You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the Bug:
Originally called out as a concern in the V2 PR. When an event is created inside of a transaction, the corresponding EventJob fires before the event itself is created. This leads to a DeserializationError which is then discarded, so the failure was quite tricky to track down.
To Reproduce:
A little tricky to reproduce here because it is a race condition, but our code looks like this:
Person.transaction do
... other changes ...
ReportComplete.with(report: report).deliver(report.user)
end
Expected Behavior:
EventJob's are created after the event is committed to the database.
Actual Behavior:
EventJob's are fired off before the event is committed to the database.
Environment:
Noticed gem version: 2.3.1
Ruby version: 3.3.1
Rails version: 7.1.3.3
Operating System: OSX 14.5
Possible Fix:
Seems like using an after_commit callback to fire the job should work.
Bug Report
Describe the Bug:
Originally called out as a concern in the V2 PR. When an event is created inside of a transaction, the corresponding
EventJob
fires before the event itself is created. This leads to a DeserializationError which is then discarded, so the failure was quite tricky to track down.To Reproduce:
A little tricky to reproduce here because it is a race condition, but our code looks like this:
Expected Behavior:
EventJob's are created after the event is committed to the database.
Actual Behavior:
EventJob's are fired off before the event is committed to the database.
Environment:
Possible Fix:
Seems like using an after_commit callback to fire the job should work.
Related Issues:
#313 (comment)
Checklist:
The text was updated successfully, but these errors were encountered: