Closed kuahyeow closed 1 year ago
~Note this includes a commit from https://github.com/mbleigh/acts-as-taggable-on/pull/1080~ That PR has since been merged, so rebased away
This is now ready for a look !
Hi @seuros - Any feedback on this PR ?
Could we get the ball rolling on this please @mbleigh @seuros ? When dealing with concurrency or bulk editing this is highly annoying and frankly dangerous as the models are seemingly saved (update/update!/save/save!) when in actuality the data has been rolled back. The taggings however get created. To add to the misery the paper trail audit record gets rolled back too. Thanks
This is what would fix our data loss I believe as well. Thank you for trying to address it. 👍
@jakswa can you try master directly ? if you confirm that it indeed resolve your issue, i will release a a new version.
I'm going to clean up the code base.
@seuros we have been testing it today and so far so good 🤞 usually we'd have a few cases per day crop up
Still no cases cropping back up 🎉. I'll remember to post back in here if we find any problems with this changeset, but going into the weekend feeling good! Thank you again!
Related to https://github.com/mbleigh/acts-as-taggable-on/issues/1068, https://github.com/mbleigh/acts-as-taggable-on/issues/948
In the find_or_create_all_with_like_by_name method, instead of issuing a ROLLBACK statement, we wrap the tag creation in a transaction instead.
Issuing a ROLLBACK will break nested transactions, and also does not respect multiple databases (available since Rails 6).
Adds a spec which attempts to simulate concurrent tag creation