Skip to content

Fix ExtraProperties filter bypass in Mapperly single-parameter Map#25486

Merged
salihozkara merged 1 commit into
rel-10.4from
fix-mapperly-single-parameter-extra-properties-filter
May 28, 2026
Merged

Fix ExtraProperties filter bypass in Mapperly single-parameter Map#25486
salihozkara merged 1 commit into
rel-10.4from
fix-mapperly-single-parameter-extra-properties-filter

Conversation

@maliming

Copy link
Copy Markdown
Member

Single-parameter IObjectMapper.Map<TSource, TDestination>(source) was bypassing [MapExtraProperties] filtering since #23694, because the destination snapshot was taken after Mapperly copied source.ExtraProperties into the new destination. Restore the original behavior by starting MapExtraProperties from an empty dictionary for both mapper and reverseMapper single-parameter paths.

Resolves #25485.

Copilot AI review requested due to automatic review settings May 28, 2026 04:37

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes Mapperly single-parameter object mapping so [MapExtraProperties] filtering is applied correctly and unwanted ExtraProperties are not retained from Mapperly’s initial copy.

Changes:

  • Starts single-parameter Map/ReverseMap extra-property merging from an empty dictionary.
  • Adds forward, reverse, and dictionary-reference tests for the corrected behavior.
  • Registers new extensible reverse-map test types and properties.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.

Show a summary per file
File Description
framework/src/Volo.Abp.Mapperly/Volo/Abp/Mapperly/MapperlyAutoObjectMappingProvider.cs Updates single-parameter Mapperly extra-property handling to avoid copied source extras bypassing filters.
framework/test/Volo.Abp.Mapperly.Tests/Volo/Abp/Mapperly/SampleClasses/MapperlyMappers.cs Adds extensible reverse-map test types and mapper.
framework/test/Volo.Abp.Mapperly.Tests/Volo/Abp/Mapperly/MapperlyTestModule.cs Registers extension properties used by the new reverse-map tests.
framework/test/Volo.Abp.Mapperly.Tests/Volo/Abp/Mapperly/ExtraProperties_Dictionary_Reference_Tests.cs Adds coverage for avoiding shared ExtraProperties references in single-parameter mapping.
framework/test/Volo.Abp.Mapperly.Tests/Volo/Abp/Mapperly/AbpReverseMapperly_Tests.cs Adds reverse single-parameter filtering coverage.
framework/test/Volo.Abp.Mapperly.Tests/Mapperly/AbpAutoMapperExtensibleDtoExtensions_Tests.cs Adds forward single-parameter extra-property filtering and regular-property mapping coverage.

@maliming maliming requested a review from salihozkara May 28, 2026 04:54
@codecov

codecov Bot commented May 28, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 49.41%. Comparing base (868c729) to head (61ed99b).

Additional details and impacted files
@@             Coverage Diff              @@
##           rel-10.4   #25486      +/-   ##
============================================
- Coverage     49.42%   49.41%   -0.01%     
============================================
  Files          3670     3670              
  Lines        123599   123599              
  Branches       9453     9453              
============================================
- Hits          61083    61080       -3     
  Misses        60682    60682              
- Partials       1834     1837       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@maliming maliming added this to the 10.4-patch milestone May 28, 2026
@salihozkara salihozkara merged commit 654e8ae into rel-10.4 May 28, 2026
5 checks passed
@salihozkara salihozkara deleted the fix-mapperly-single-parameter-extra-properties-filter branch May 28, 2026 10:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants