-
-
Notifications
You must be signed in to change notification settings - Fork 353
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use after_save instead of after_commit for clear_scope_changed callback #407
Use after_save instead of after_commit for clear_scope_changed callback #407
Conversation
Hi @Flixt, sorry for the delay. Summer holidays here :) At the very least it should be
|
Hi @brendon, no worries.
Using
I agree, but still there seems to be a bug triggered by exactly that line. |
Sorry! I was reading the change backward! :D Let's see how it tests out across the suite :) |
Looking good :) Would you mind adding a quick changelog line to the commit and we should be all good :) |
The problem is, when running multiple updates of the same objects withing the same transaction, only firing `clear_scope_changed` after the transaction commit can lead to duplicate positions.
3f54fe9
to
4c6185d
Compare
I added the line to the changelog. Not sure about if you'd want this change to be marked as a "breaking change". |
Thanks @Flixt, that's a helpful fix :) |
Are you happy to use the master branch for a while and let me know if you notice any issues? Then I can release a version. |
Yup, we will use the fix from our fork for a while. |
I've released |
The problem is, when running multiple updates of the same objects within the same transaction, only firing
clear_scope_changed
after the transaction commit can lead to duplicate positions.Without the change the test included in this PR fails with (run with
ruby -I test test/test_list.rb --name test_multiple_updates_within_transaction
):Actually I have no idea if changing this callback from
after_commit
to after_save` is the "correct" way to fix this.