Fix runtime bugs & add TryBindConfiguration / IServiceCollection.RegisterAzureStorage#55
Draft
Copilot wants to merge 3 commits into
Draft
Fix runtime bugs & add TryBindConfiguration / IServiceCollection.RegisterAzureStorage#55Copilot wants to merge 3 commits into
Copilot wants to merge 3 commits into
Conversation
…ureStorage, improve docs Agent-Logs-Url: https://github.com/mathieumack/MDev.Dotnet/sessions/8dbae19d-ba3a-4262-89e0-e8af463924e1 Co-authored-by: mathieumack <12582537+mathieumack@users.noreply.github.com>
Agent-Logs-Url: https://github.com/mathieumack/MDev.Dotnet/sessions/8dbae19d-ba3a-4262-89e0-e8af463924e1 Co-authored-by: mathieumack <12582537+mathieumack@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Propose new features and improvements for developer benefit
Fix runtime bugs & add TryBindConfiguration / IServiceCollection.RegisterAzureStorage
Apr 21, 2026
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.
Three latent runtime bugs fixed and two developer-experience additions to align patterns across packages.
Bug fixes
PersistentService.SaveOnBlobAsync— mutatedmetadatasdictionary while iterating it (guaranteedInvalidOperationException); also called fire-and-forgetSetMetadatainstead ofawait SetMetadataAsync. Fixed by projecting to a new dictionary and awaiting the async overload.IHttpContextAccessorExtensions.GetClaims— calledConvert.FromBase64Stringon a potentially empty/missing header value, then dereferenced the deserialized result without null-checking. Now returnsEnumerable.Empty<UserClaim>()on missing token or failed deserialization.RequireDaprApiTokenAttribute— cached the expected token instaticfields (_expectedToken/_initialized), making the token stale across test runs and introducing a startup race. Now reads fromIConfigurationper-request via the scopedIServiceProvider.New APIs
TryBindConfiguration<T>— optional-section variants ofBindConfiguration<T>on bothIHostApplicationBuilderandIServiceCollection. Silent no-op when the section is absent rather than throwing.IServiceCollection.RegisterAzureStorage— directIServiceCollectionoverload mirroring the existingRegisterCosmosDb(IServiceCollection, IConfiguration, TokenCredential)pattern. TheIHostApplicationBuildervariant now delegates to it.Docs
Corrected misleading "Bing configuration object on section" summaries and added missing
<typeparam>/<returns>XML doc tags acrossStartupRegistersExtensions.