@@ -90,10 +90,10 @@ const CLIENT_NOT_INITIALIZED_EVALUATION_ERROR = {
9090 code : "CLIENT_NOT_INITIALIZED" ,
9191 field : "" ,
9292 message :
93- "ReflagClient was not initialized before this flag was evaluated. Call initialize() before evaluating flags." ,
93+ "Flag was evaluated before the initial flag state was available. Await initialize() or wait for SDK loading to complete before evaluating flags." ,
9494} as const ;
9595
96- function withClientInitializationDiagnostic (
96+ function withClientInitializationError (
9797 errors : FlagEvent [ "evalErrors" ] ,
9898 evaluatedBeforeInitialization : boolean ,
9999) : FlagEvent [ "evalErrors" ] {
@@ -1257,7 +1257,7 @@ export class ReflagClient {
12571257 * @param event.evalContext - The evaluation context of the flag to send.
12581258 * @param event.evalRuleResults - The evaluation rule results of the flag to send.
12591259 * @param event.evalMissingFields - The evaluation missing fields of the flag to send.
1260- * @param event.evalErrors - The non-fatal evaluation diagnostics of the flag to send.
1260+ * @param event.evalErrors - The non-fatal evaluation errors of the flag to send.
12611261 *
12621262 * @throws An error if the event is invalid.
12631263 *
@@ -1377,11 +1377,11 @@ export class ReflagClient {
13771377 }
13781378
13791379 /**
1380- * Warns if a flag or config evaluation produced diagnostics .
1380+ * Warns if a flag or config evaluation produced errors .
13811381 *
13821382 * @param flag - The flag to check.
13831383 */
1384- private _warnFlagEvaluationDiagnostics ( flag : {
1384+ private _warnFlagEvaluationErrors ( flag : {
13851385 key : string ;
13861386 missingContextFields ?: string [ ] ;
13871387 evaluationErrors ?: EvaluationError [ ] ;
@@ -1474,7 +1474,7 @@ export class ReflagClient {
14741474 checkContextWithTracking ( options ) ;
14751475
14761476 if ( ! this . initializationFinished && ! this . _config . offline ) {
1477- this . logger . error ( "getFlag(s): ReflagClient is not initialized yet." ) ;
1477+ this . logger . error ( CLIENT_NOT_INITIALIZED_EVALUATION_ERROR . message ) ;
14781478 }
14791479
14801480 void this . syncContext ( options ) ;
@@ -1589,19 +1589,19 @@ export class ReflagClient {
15891589 : { key : undefined , payload : undefined } ;
15901590 const evaluatedBeforeInitialization =
15911591 ! this . initializationFinished && ! this . _config . offline ;
1592- const flagEvaluationErrors = withClientInitializationDiagnostic (
1592+ const flagEvaluationErrors = withClientInitializationError (
15931593 flag . evaluationErrors ,
15941594 evaluatedBeforeInitialization ,
15951595 ) ;
1596- const configEvaluationErrors = withClientInitializationDiagnostic (
1596+ const configEvaluationErrors = withClientInitializationError (
15971597 config ?. evaluationErrors ,
15981598 evaluatedBeforeInitialization ,
15991599 ) ;
16001600
16011601 return {
16021602 get isEnabled ( ) {
16031603 if ( enableTracking && enableChecks ) {
1604- client . _warnFlagEvaluationDiagnostics ( flag ) ;
1604+ client . _warnFlagEvaluationErrors ( flag ) ;
16051605
16061606 void client
16071607 . sendFlagEvent ( {
@@ -1625,7 +1625,7 @@ export class ReflagClient {
16251625 } ,
16261626 get config ( ) {
16271627 if ( enableTracking && enableChecks ) {
1628- client . _warnFlagEvaluationDiagnostics ( { ...flag , config } ) ;
1628+ client . _warnFlagEvaluationErrors ( { ...flag , config } ) ;
16291629
16301630 void client
16311631 . sendFlagEvent ( {
0 commit comments