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.
Problem
This PR fixes issues with our existing mutex lock. It has been tested on both local dev and staging.
Currently, our route handler behaviour seems to suffer from 2 issues that make our mutex locks not work as intended:
next
does not cut off the remainder of the method, and must be cut off explicitly - in our existing implementation, even if the mutex lock is hit, the actual route still continues to executeThis PR modifies the behaviour of both our write and rollback wrappers to handle this scenario.
In addition, the returned error has been modified from
409
to423
(Locked) - this is to better reflect the reason for rejecting the request, and also results in a regular error toast on the frontend instead of the special conflict modal that would normally show up for modification of outdated files.Resolves IS-478