Lock appropriate tree for media operations#19422
Lock appropriate tree for media operations#19422AndyButland merged 1 commit intoumbraco:v13/mainfrom
Conversation
The MediaService currently locks the ContentTree for GetPagedOfType(s) operations, but it's querying the MediaTree. This ensures we lock the correct tree.
|
Hi there @rbottema, thank you for this contribution! 👍 While we wait for one of the Core Collaborators team to have a look at your work, we wanted to let you know about that we have a checklist for some of the things we will consider during review:
Don't worry if you got something wrong. We like to think of a pull request as the start of a conversation, we're happy to provide guidance on improving your contribution. If you realize that you might want to make some changes then you can do that by adding new commits to the branch you created for this work and pushing new commits. They should then automatically show up as updates to this pull request. Thanks, from your friendly Umbraco GitHub bot 🤖 🙂 |
There was a problem hiding this comment.
Pull Request Overview
Fixes the lock used for media queries to ensure the MediaTree is locked rather than the ContentTree.
- Updated the read lock in
GetPagedOfTypeto useMediaTree - Updated the read lock in
GetPagedOfTypesto useMediaTree
Comments suppressed due to low confidence (2)
src/Umbraco.Core/Services/MediaService.cs:421
- Consider adding a unit or integration test to verify that
GetPagedOfTypeacquires theMediaTreelock as intended, preventing regressions in the locking behavior.
scope.ReadLock(Constants.Locks.MediaTree);
src/Umbraco.Core/Services/MediaService.cs:444
- Consider adding a unit or integration test to verify that
GetPagedOfTypesacquires theMediaTreelock as intended, preventing regressions in the locking behavior.
scope.ReadLock(Constants.Locks.MediaTree);
There was a problem hiding this comment.
Thanks @rbottema - looks a clear and obvious fix, will include for 13.10.
The MediaService currently locks the ContentTree for GetPagedOfType(s) operations, but it's querying the MediaTree. This ensures we lock the correct tree.
The MediaService currently locks the ContentTree for GetPagedOfType(s) operations, but it's querying the MediaTree. This ensures we lock the correct tree.