Skip to content

Conversation

@amerjusupovic
Copy link
Contributor

No description provided.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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

Comments suppressed due to low confidence (2)

src/Microsoft.Extensions.Configuration.AzureAppConfiguration/AzureAppConfigurationRefresherProvider.cs:42

  • The constructor calls DiscoverRefreshers() to initialize _refreshers but does not set _rediscoveredRefreshers to true, so the property getter may invoke DiscoverRefreshers() again. Consider setting _rediscoveredRefreshers to true in the constructor after the initial discovery if that behavior is not intended.
            _refreshers = DiscoverRefreshers();

src/Microsoft.Extensions.Configuration.AzureAppConfiguration/AzureAppConfigurationExtensions.cs:103

  • [nitpick] Switching from AddSingleton to TryAddSingleton prevents duplicate registrations. Please confirm that this change aligns with the intended dependency injection behavior for scenarios where multiple registrations may occur.
                services.TryAddSingleton<IConfigurationRefresherProvider, AzureAppConfigurationRefresherProvider>();

@amerjusupovic amerjusupovic merged commit 2de6c93 into main Apr 11, 2025
3 checks passed
@amerjusupovic amerjusupovic deleted the ajusupovic/extension-idempotent-fix branch April 11, 2025 21:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

AddAzureAppConfiguration - Use TryAddSingleton instead of AddSingleton

3 participants