Skip to content

Commit e4eedc9

Browse files
committed
handle page deletion
1 parent 453dad3 commit e4eedc9

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

src/AzureAppConfigurationImpl.ts

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -446,12 +446,23 @@ export class AzureAppConfigurationImpl implements AzureAppConfiguration {
446446
this.#client,
447447
listOptions
448448
).byPage();
449+
450+
let pageCount = 0;
449451
for await (const page of pageIterator) {
450452
if (page._response.status === 200) { // created or changed
451453
needRefresh = true;
452454
break;
453455
}
454-
// TODO: handle page deleted?
456+
// unchanged, check next page
457+
pageCount++;
458+
}
459+
460+
if (pageCount !== selector.pageEtags?.length) {
461+
needRefresh = true; // page count changed indicating feature flags are added or deleted
462+
}
463+
464+
if (needRefresh) {
465+
break; // short-circuit if result from any of the selectors is changed
455466
}
456467
}
457468

0 commit comments

Comments
 (0)