File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed
Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -385,6 +385,14 @@ export class OpenFeatureAPI
385385 oldContext : EvaluationContext ,
386386 newContext : EvaluationContext ,
387387 ) : Promise < void > {
388+ // if the provider hasn't initialized yet, and isn't actively initializing, initialize instead of running context change handler
389+ // the provider will be in this state if the user requested delayed initialization until the first context change
390+ const initializationPromise = this . initializeProviderForDomain ( wrapper , domain ) ;
391+ if ( initializationPromise ) {
392+ await initializationPromise ;
393+ return ;
394+ }
395+
388396 // this should always be set according to the typings, but let's be defensive considering JS
389397 const providerName = wrapper . provider ?. metadata ?. name || 'unnamed-provider' ;
390398
You can’t perform that action at this time.
0 commit comments