Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refresh key value collection based on page etag #133

Merged
merged 16 commits into from
Dec 19, 2024

Conversation

zhiyuanliang-ms
Copy link
Contributor

@zhiyuanliang-ms zhiyuanliang-ms commented Nov 18, 2024

Why this PR?

This PR supports refreshing key value based on page etag (aka key value collection monitoring).

Visible change

  • When refreshOption.enabled is true and no watched setting is specified, then the provider will watch all selected key value to refresh the configuration

  • This PR also re-organize the AzureAppConfigurationImpl (1. adjust the method order 2. add more comments 3. simplify the code path 4. make more function resuable

Note

Some corner cases:

  1. If you load the following kvs and ffs:
{
  selector: [{keyFilter: "*"}],
  refreshOptions: {
    enabled: true
  }
}

with this load option, the feature_management section will not appear in the local configuration (provider will ignore feature flag configuration settings), because user doesn't use the feature flag in the load options (i.e. AzureAppConfigurationOptions.feaetureFlagOptions.

However, if users changes any feature flag through the portal, the page etag of monitored key value collection (of selector with keyFilter of "*") will change. So it will trigger a real refresh. Even if, all the key value loaded to local configuration will be the same as the previous one.

This behavior may only affect the scenario when onRefresh callback is used. Otherwise, user will never notice this.

Reference

.NET provider PR

@zhiyuanliang-ms zhiyuanliang-ms force-pushed the zhiyuanliang/register-all-refresh branch from 0b6d9c0 to fdd30e2 Compare November 18, 2024 17:12
@zhiyuanliang-ms zhiyuanliang-ms changed the title Key Value refresh based on pageEtag refresh keyvalue based on page etag Nov 18, 2024
@zhiyuanliang-ms zhiyuanliang-ms changed the title refresh keyvalue based on page etag Refresh keyvalue based on page etag Nov 18, 2024
@zhiyuanliang-ms zhiyuanliang-ms changed the title Refresh keyvalue based on page etag Refresh key value collection based on page etag Nov 18, 2024
src/AzureAppConfigurationImpl.ts Outdated Show resolved Hide resolved
src/AzureAppConfigurationImpl.ts Outdated Show resolved Hide resolved
src/AzureAppConfigurationImpl.ts Outdated Show resolved Hide resolved
src/AzureAppConfigurationImpl.ts Show resolved Hide resolved
@zhiyuanliang-ms zhiyuanliang-ms mentioned this pull request Nov 20, 2024
@RichardChen820
Copy link

LGTM

src/AzureAppConfigurationImpl.ts Outdated Show resolved Hide resolved
src/AzureAppConfigurationImpl.ts Show resolved Hide resolved
@zhiyuanliang-ms zhiyuanliang-ms merged commit 71aebab into preview Dec 19, 2024
4 checks passed
@zhiyuanliang-ms zhiyuanliang-ms deleted the zhiyuanliang/register-all-refresh branch December 19, 2024 05:51
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.

8 participants