Skip to content

Commit

Permalink
action pr feedback
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Beemer <[email protected]>
  • Loading branch information
beeme1mr committed Jan 7, 2025
1 parent 5fbc688 commit b7f7632
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 1 deletion.
2 changes: 2 additions & 0 deletions libs/shared/flagd-core/src/lib/feature-flag.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ type RequiredResolutionDetails<T> = Omit<ResolutionDetails<T>, 'value'> & {
| {
value: T;
variant: string;
errorCode?: never;
errorMessage?: never;
}
);

Expand Down
1 change: 1 addition & 0 deletions libs/shared/flagd-core/src/lib/flagd-core.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,7 @@ describe('flagd-core error conditions', () => {
},
logger,
);
/* eslint-disable @typescript-eslint/no-explicit-any */
(featureFlag as any)['_targeting'] = () => {
throw new Error('something broke');
};
Expand Down
5 changes: 4 additions & 1 deletion libs/shared/flagd-core/src/lib/flagd-core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,10 @@ export class FlagdCore implements Storage {

const resolution = flag.evaluate(evalCtx, logger);

// Error during evaluation, returning default value
/**
* A resolution without a value represents an error condition. It contains
* information about the error but requires the default value set.
*/
if (resolution.value === undefined) {
return {
...resolution,
Expand Down
1 change: 1 addition & 0 deletions libs/shared/flagd-core/src/lib/parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ export function parse(flagConfig: string, strictValidation: boolean, logger: Log
flagsKey,
{
...flag,
// Flag metadata has higher precedence than flag set metadata
metadata: {
...parsedFlagConfig.metadata,
...flag.metadata,
Expand Down

0 comments on commit b7f7632

Please sign in to comment.