Blob container ProviderType does not fall back to default container configuration#25615
Conversation
Co-authored-by: Cursor <cursoragent@cursor.com>
There was a problem hiding this comment.
Pull request overview
This PR fixes blob provider resolution for named blob containers by ensuring BlobContainerConfiguration.ProviderType properly falls back to the default container’s configuration when it isn’t explicitly set on the named container.
Changes:
- Implemented fallback-aware
ProviderTypeinBlobContainerConfiguration(mirroring existing fallback behavior of custom configuration values). - Added a test container configuration (
TestContainer3) that only sets non-provider options to validate fallback behavior. - Extended the existing fallback test assertions to cover
IsMultiTenantfor the specialized container.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| framework/src/Volo.Abp.BlobStoring/Volo/Abp/BlobStoring/BlobContainerConfiguration.cs | Makes ProviderType resolve via _fallbackConfiguration when not explicitly set. |
| framework/test/Volo.Abp.BlobStoring.Tests/Volo/Abp/BlobStoring/AbpBlobStoringTestModule.cs | Configures TestContainer3 with only non-provider options to exercise the fallback path. |
| framework/test/Volo.Abp.BlobStoring.Tests/Volo/Abp/BlobStoring/AbpBlobStoringOptions_Tests.cs | Asserts ProviderType fallback works and verifies IsMultiTenant is applied for the named container. |
…licitly configured
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## rel-10.4 #25615 +/- ##
============================================
- Coverage 49.38% 49.36% -0.02%
============================================
Files 3671 3674 +3
Lines 123885 123944 +59
Branches 9470 9470
============================================
+ Hits 61179 61184 +5
- Misses 60885 60928 +43
- Partials 1821 1832 +11 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Hi @EngincanV, pushed one more edge fix on top of your ProviderType change.
|
Problem
When configuring a named blob container with only non-provider options, such as
IsMultiTenant, the container loses access to the default provider configuration.Example:
In this case,
WorkspaceDataSourceBlobContaineris created as a specialized named container with the default container as its fallback. However,ProviderTypeis a direct auto-property onBlobContainerConfiguration, so it does not use the fallback configuration.As a result, provider resolution fails with:
Expected Behavior
A named blob container should inherit
ProviderTypefrom the default container when it does not explicitly set its own provider type. (if it's null)This should behave consistently with other configuration values that already fall back through
_fallbackConfiguration.Actual Behavior
Custom configuration values use fallback resolution, but
ProviderTypedoes not.This means a container configured only for options like
IsMultiTenantmust also repeat the provider configuration, even when a default provider is already configured.Suggested Fix
Update
BlobContainerConfiguration.ProviderTypeto use the fallback configuration when the current container has no explicit provider type.Suggested implementation: