Skip to content

Commit

Permalink
fix: reset current promise after every config request (#939)
Browse files Browse the repository at this point in the history
  • Loading branch information
kaushalkapasi authored Aug 20, 2024
1 parent 15a7718 commit 6710e1a
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions sdk/js/src/ConfigRequestConsolidator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,12 @@ export class ConfigRequestConsolidator {
this.requestParams ? this.requestParams : undefined,
)
this.requestParams = null
const bucketedConfig = await this.currentPromise
this.currentPromise = null
const bucketedConfig = await this.currentPromise.finally(() => {
// clear the current promise so we can make another request
// this should happen regardless of whether the request was successful or not
this.currentPromise = null
})

return bucketedConfig
}
}

0 comments on commit 6710e1a

Please sign in to comment.