File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -166,14 +166,12 @@ function evaluateCondition(
166166 return contextValue === castedValue ? "matched" : "not_matched" ;
167167
168168 case "in" :
169- return Array . isArray ( castedValue ) && castedValue . includes ( contextValue )
170- ? "matched"
171- : "not_matched" ;
169+ if ( ! Array . isArray ( castedValue ) ) return "unknown" ;
170+ return castedValue . includes ( contextValue ) ? "matched" : "not_matched" ;
172171
173172 case "not_in" :
174- return Array . isArray ( castedValue ) && ! castedValue . includes ( contextValue )
175- ? "matched"
176- : "not_matched" ;
173+ if ( ! Array . isArray ( castedValue ) ) return "unknown" ;
174+ return ! castedValue . includes ( contextValue ) ? "matched" : "not_matched" ;
177175
178176 case "less_than" :
179177 if ( typeof contextValue === "number" && typeof castedValue === "number" ) {
@@ -768,14 +766,19 @@ function _createReplaneClient(
768766 if ( isWatcherClosed ) {
769767 throw new Error ( "Config value watcher is closed" ) ;
770768 }
771- return evaluateOverrides < T > (
772- currentConfig . value ,
773- currentConfig . overrides ,
774- {
775- ...options . context ,
776- ...context ,
777- }
778- ) ;
769+ try {
770+ return evaluateOverrides < T > (
771+ currentConfig . value ,
772+ currentConfig . overrides ,
773+ {
774+ ...options . context ,
775+ ...context ,
776+ }
777+ ) ;
778+ } catch ( err ) {
779+ options . logger . error ( `ReplaneConfigWatcherWorker error: ${ err } ` ) ;
780+ return currentConfig . value ;
781+ }
779782 } ,
780783 close ( ) {
781784 if ( isWatcherClosed ) return ;
You can’t perform that action at this time.
0 commit comments