File tree Expand file tree Collapse file tree 1 file changed +4
-7
lines changed Expand file tree Collapse file tree 1 file changed +4
-7
lines changed Original file line number Diff line number Diff line change @@ -590,21 +590,19 @@ export class AzureAppConfigurationImpl implements AzureAppConfiguration {
590590 * Updates etag of watched settings from loaded data. If a watched setting is not covered by any selector, a request will be sent to retrieve it.
591591 */
592592 async #updateWatchedKeyValuesEtag( existingSettings : ConfigurationSetting [ ] ) : Promise < void > {
593+ const updatedSentinels : ConfigurationSettingId [ ] = [ ] ;
593594 for ( const sentinel of this . #sentinels) {
594595 const matchedSetting = existingSettings . find ( s => s . key === sentinel . key && s . label === sentinel . label ) ;
595596 if ( matchedSetting ) {
596- sentinel . etag = matchedSetting . etag ;
597+ updatedSentinels . push ( { ... sentinel , etag : matchedSetting . etag } ) ;
597598 } else {
598599 // Send a request to retrieve key-value since it may be either not loaded or loaded with a different label or different casing
599600 const { key, label } = sentinel ;
600601 const response = await this . #getConfigurationSetting( { key, label } ) ;
601- if ( response ) {
602- sentinel . etag = response . etag ;
603- } else {
604- sentinel . etag = undefined ;
605- }
602+ updatedSentinels . push ( { ...sentinel , etag : response ?. etag } ) ;
606603 }
607604 }
605+ this . #sentinels = updatedSentinels ;
608606 }
609607
610608 /**
@@ -662,7 +660,6 @@ export class AzureAppConfigurationImpl implements AzureAppConfiguration {
662660 if ( response ?. statusCode === 200 // created or changed
663661 || ( response === undefined && sentinel . etag !== undefined ) // deleted
664662 ) {
665- sentinel . etag = response ?. etag ; // update etag of the sentinel
666663 needRefresh = true ;
667664 break ;
668665 }
You can’t perform that action at this time.
0 commit comments