-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Performance: Optimize property retrieval and authorization checks in collection views (closes #21367) #21470
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
Merged
AndyButland
merged 17 commits into
main
from
v17/improvement/optimize-collection-view-property-retrieval
Jan 26, 2026
Merged
Changes from 6 commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
255f14e
Introduce new method overloads and repository implentation, such that…
AndyButland 5106da9
Use non-obsolete method overloads throughout.
AndyButland 47abde9
Add unit tests to verify property value retrieval.
AndyButland 9e9acc9
Don't load templates for collection view content retrieval.
AndyButland 1c74f6a
Optimize access checks by verifying the full collection rather than o…
AndyButland 5b414d0
Added obsoletion messages and aligned behaviour of content and media …
AndyButland bb098f2
Apply suggestions from code review
AndyButland 88e0463
Return key in TreeEntityPath collection response, avoiding a later lo…
AndyButland 38a502d
Merge branch 'main' into v17/improvement/optimize-collection-view-pro…
AndyButland 7d7e0f3
Resolve breaking changes to interfaces.
AndyButland 1680b96
Fix further breaking change.
AndyButland dcfc548
Merge branch 'main' into v17/improvement/optimize-collection-view-pro…
AndyButland cb569b3
Additional assert for test verifying property loading for a non-exist…
AndyButland eb43149
Refactored repositories to avoid having method parameters related to …
AndyButland 5e18dad
Remove check that verifies all provided keys are found when doing per…
AndyButland 6cd8bac
Introduce variable for permission set permissions.
AndyButland 9ce4328
Provide functional default implementation on FilterAuthorizedAsync.
AndyButland File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 43 additions & 1 deletion
44
src/Umbraco.Core/Services/IContentSearchService{TContent}.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,14 +1,56 @@ | ||
| using Umbraco.Cms.Core.Models; | ||
| using Umbraco.Cms.Core.Models; | ||
|
|
||
| namespace Umbraco.Cms.Core.Services; | ||
|
|
||
| /// <summary> | ||
| /// Defines methods for searching and retrieving child content items of a specified parent, with support for filtering, | ||
| /// ordering, and paging. | ||
| /// </summary> | ||
| /// <typeparam name="TContent">The type of content item to search for. Must implement <see cref="IContentBase"/>.</typeparam> | ||
| public interface IContentSearchService<TContent> | ||
| where TContent : class, IContentBase | ||
| { | ||
| /// <summary> | ||
| /// Searches for children of a content item. | ||
| /// </summary> | ||
| /// <param name="query">The search query.</param> | ||
| /// <param name="parentId">The parent content item key.</param> | ||
| /// <param name="ordering">The ordering.</param> | ||
| /// <param name="skip">The number of items to skip.</param> | ||
| /// <param name="take">The number of items to take.</param> | ||
| /// <returns>A paged model of content items.</returns> | ||
| [Obsolete("Please use the method overload with all parameters. Scheduled for removal in Umbraco 19.")] | ||
| Task<PagedModel<TContent>> SearchChildrenAsync( | ||
| string? query, | ||
| Guid? parentId, | ||
| Ordering? ordering, | ||
| int skip = 0, | ||
| int take = 100) | ||
| => SearchChildrenAsync(query, parentId, propertyAliases: null, ordering: ordering, skip: skip, take: take); | ||
|
Check warning on line 29 in src/Umbraco.Core/Services/IContentSearchService{TContent}.cs
|
||
|
|
||
| /// <summary> | ||
| /// Searches for children of a content item with optional property filtering. | ||
| /// </summary> | ||
| /// <param name="query">The search query.</param> | ||
| /// <param name="parentId">The parent content item key.</param> | ||
| /// <param name="propertyAliases"> | ||
| /// The property aliases to load. If null, all properties are loaded. | ||
| /// If empty array, no custom properties are loaded. | ||
| /// </param> | ||
| /// <param name="ordering">The ordering.</param> | ||
| /// <param name="loadTemplates"> | ||
| /// Whether to load templates. Set to false for performance optimization when templates are not needed | ||
| /// (e.g., collection views). Default is true. Only applies to Document content; ignored for Media/Member. | ||
| /// </param> | ||
| /// <param name="skip">The number of items to skip.</param> | ||
| /// <param name="take">The number of items to take.</param> | ||
| /// <returns>A paged model of content items.</returns> | ||
| Task<PagedModel<TContent>> SearchChildrenAsync( | ||
| string? query, | ||
| Guid? parentId, | ||
| string[]? propertyAliases, | ||
| Ordering? ordering, | ||
| bool loadTemplates = true, | ||
| int skip = 0, | ||
| int take = 100); | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.