Code Tidy: Clean up further obsoleted code scheduled for removal in Umbraco 18 (IEmailSender, MemberConfigurationResponseModel, MediaPermissions)#22642
Merged
Conversation
|
Claude encountered an error —— View job I'll analyze this and get back to you. |
IEmailSender, MemberConfigurationResponseModel, MediaPermissions)
Contributor
There was a problem hiding this comment.
Pull request overview
Removes additional obsolete APIs/types scheduled for removal in Umbraco 18, including email sender overloads, an unused member-configuration management endpoint/model, and the legacy MediaPermissions class in favor of IMediaPermissionService.
Changes:
- Removed obsolete
IEmailSender.SendAsyncoverloads and updated implementations accordingly. - Removed the unused Management API member configuration endpoint/model and its presentation factory method.
- Removed obsolete
MediaPermissions+ DI registration, and replaced legacy tests withMediaPermissionServiceTestsforIMediaPermissionService.
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| tests/Umbraco.Tests.UnitTests/Umbraco.Core/Services/MediaPermissionServiceTests.cs | Adds unit coverage for IMediaPermissionService scenarios (including multi-key + filtering). |
| tests/Umbraco.Tests.UnitTests/Umbraco.Core/Security/MediaPermissionsTests.cs | Removes tests for the obsolete MediaPermissions class. |
| src/Umbraco.Infrastructure/Mail/EmailSender.cs | Drops obsolete SendAsync overload implementations. |
| src/Umbraco.Core/Security/MediaPermissions.cs | Removes the obsolete MediaPermissions class. |
| src/Umbraco.Core/Mail/NotImplementedEmailSender.cs | Drops obsolete SendAsync overloads, keeping the modern signature. |
| src/Umbraco.Core/Mail/IEmailSender.cs | Removes obsolete overloads and default interface bridging implementation. |
| src/Umbraco.Core/DependencyInjection/UmbracoBuilder.cs | Removes DI registration of the obsolete MediaPermissions. |
| src/Umbraco.Cms.Api.Management/ViewModels/Member/MemberConfigurationResponseModel.cs | Removes the obsolete/empty response model. |
| src/Umbraco.Cms.Api.Management/Factories/IConfigurationPresentationFactory.cs | Removes the member configuration presentation factory method. |
| src/Umbraco.Cms.Api.Management/Factories/ConfigurationPresentationFactory.cs | Removes the factory implementation for the member configuration model. |
| src/Umbraco.Cms.Api.Management/Controllers/Member/ConfigurationMemberController.cs | Removes the orphaned member configuration controller/endpoint. |
Comments suppressed due to low confidence (1)
src/Umbraco.Cms.Api.Management/Factories/ConfigurationPresentationFactory.cs:83
- After removing the member configuration response model/controller, the generated backoffice client code still exposes this operation/model (e.g.
src/Umbraco.Web.UI.Client/src/packages/core/backend-api/sdk.gen.ts#getMemberConfigurationandtypes.gen.tsstill containMemberConfigurationResponseModel). Please regenerate/update the OpenAPI-driven client artifacts (or remove the stale operation/model) so the repo doesn’t keep shipping a client that targets a now-removed endpoint (/umbraco/management/api/v1/member/configuration).
/// <summary>
/// Creates a <see cref="Umbraco.Cms.Api.Management.Models.MemberTypeConfigurationResponseModel"/> containing the reserved member field names.
/// </summary>
/// <returns>A <see cref="Umbraco.Cms.Api.Management.Models.MemberTypeConfigurationResponseModel"/> with reserved member field names populated.</returns>
public MemberTypeConfigurationResponseModel CreateMemberTypeConfigurationResponseModel() =>
new()
{
ReservedFieldNames = _reservedFieldNamesService.GetMemberReservedFieldNames(),
};
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
This is a further PR that removes obsolete members scheduled for removal in Umbraco 18, covering three independent cleanups bundled together.
1.
IEmailSenderSendAsyncoverloads:SendAsync(EmailMessage, string)SendAsync(EmailMessage, string, bool)SendAsync(EmailMessage, string, bool, TimeSpan?), which existed only to bridge the obsolete overloads.EmailSender,NotImplementedEmailSender) to drop the obsolete overloads.2.
MemberConfigurationResponseModelMemberConfigurationResponseModelview model.ConfigurationMemberControllerwhose only purpose was returning that empty model (corresponding to theGET /umbraco/management/api/v1/member/configurationendpoint).CreateMemberConfigurationResponseModel()fromIConfigurationPresentationFactoryand its implementation inConfigurationPresentationFactory.3.
MediaPermissions(inUmbraco.Cms.Core.Security)MediaPermissionsclass along with itsServices.AddSingleton<MediaPermissions>()registration.MediaPermissionsTests(7 tests covering the obsolete class).MediaPermissionServiceTestscovering the non-obsolete replacementIMediaPermissionService. The new test class mirrors all 7 original scenarios on the equivalent service methods (AuthorizeAccessAsync,AuthorizeRootAccessAsync,AuthorizeBinAccessAsync) and adds 5 further tests covering API surface that wasn't on the old class (multi-key authorize, empty-keys edge case,FilterAuthorizedAccessAsync).Testing
Build checks should pass - solution should build and test suite should complete without failures.