Open
Description
Bug Report: MultiProvider Does Not Fallback to Secondary Provider while using FlagsmithClientProvider
Description
When using WebMultiProvider
with FirstMatchStrategy
, the expected behavior is that if a flag is not defined in the primary provider (FlagsmithClientProvider
), the system should fallback to the next provider (ProviderB
). However, this does not happen as expected.
Reproduction Steps
- Configure
WebMultiProvider
as follows:const multiProvider = new WebMultiProvider( [ { provider: new FlagsmithClientProvider(), }, { provider: new ProviderB(), } ], new FirstMatchStrategy() );
- Ensure that:
- Feature flag
"xxx"
is not defined inFlagsmithClientProvider
. - Feature flag
"xxx"
is defined astrue
inProviderB
.
- Feature flag
- Request the flag
"xxx"
usingmultiProvider
.
Expected Behavior
- The flag
"xxx"
should resolve totrue
, as it is defined inProviderB
.
Actual Behavior
- The resolved value is always
false
, even thoughProviderB
has"xxx"
set totrue
.
Possible Cause
It seems that FirstMatchStrategy
only fallback to the second provider when the first one evaluates to ErrorCode.FLAG_NOT_FOUND
. However, when FlagsmithClientProvider does not find a flag, it throws TypeMismatchError.
Metadata
Metadata
Assignees
Labels
No labels