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 @@ -389,6 +389,14 @@ export class OpenFeatureAPI
389389 const providerName = wrapper . provider ?. metadata ?. name || 'unnamed-provider' ;
390390
391391 try {
392+ // if the provider hasn't initialized yet, and isn't actively initializing, initialize instead of running context change handler
393+ // the provider will be in this state if the user requested delayed initialization until the first context change
394+ const initializationPromise = this . initializeProviderForDomain ( wrapper , domain ) ;
395+ if ( initializationPromise ) {
396+ await initializationPromise ;
397+ return ;
398+ }
399+
392400 if ( typeof wrapper . provider . onContextChange === 'function' ) {
393401 const maybePromise = wrapper . provider . onContextChange ( oldContext , newContext ) ;
394402
You can’t perform that action at this time.
0 commit comments