✨ post update collision detection #8362
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
refs #5599
Same as #8328, just for master.
I had to adapt some smaller things like error handling, tests.
If two users edit the same post, it can happen that they override each others content or post settings. With this change this won't happen anymore.
✨ Update collision for posts
changed
object of bookshelf -> we don't have to create our own diff🙀 update collision for tags
updateTags
for adding posts ononCreated
- happens after the post was inserted--> it's "okay" to attach the tags afterwards on insert
--> there is no need to add collision for inserting data
--> it's very hard to move the updateTags call to
onCreating
, because theupdateTags
function queries the database to look up the affected postupdateTags
while editing posts ononSaving
- all operations run in a transactions and are rolled back if something get's rejectedPost model edit: if we push a transaction from outside, take this one
✨ introduce options.forUpdate
use options.forUpdate and protect internal post updates: model listeners
use options.forUpdate and protect internal post updates: scheduling