From 7f4f0808a65318407a482261eee012bbbcfd11a8 Mon Sep 17 00:00:00 2001 From: Todd Baert Date: Tue, 2 Apr 2024 14:17:14 -0400 Subject: [PATCH] feat: add STALE pre-defined reason (#898) Adds STALE pre-defined reason, re-orders reasons in source to match spec. Signed-off-by: Todd Baert --- packages/shared/src/evaluation/evaluation.ts | 29 ++++++++++++-------- 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/packages/shared/src/evaluation/evaluation.ts b/packages/shared/src/evaluation/evaluation.ts index c629a0af..c900b40f 100644 --- a/packages/shared/src/evaluation/evaluation.ts +++ b/packages/shared/src/evaluation/evaluation.ts @@ -38,6 +38,16 @@ export type EvaluationDetails = { } & ResolutionDetails; export const StandardResolutionReasons = { + /** + * The resolved value is static (no dynamic evaluation). + */ + STATIC: 'STATIC', + + /** + * The resolved value was configured statically, or otherwise fell back to a pre-configured value. + */ + DEFAULT: 'DEFAULT', + /** * The resolved value was the result of a dynamic evaluation, such as a rule or specific user-targeting. */ @@ -48,30 +58,25 @@ export const StandardResolutionReasons = { */ SPLIT: 'SPLIT', + /** + * The resolved value was retrieved from cache. + */ + CACHED: 'CACHED', + /** * The resolved value was the result of the flag being disabled in the management system. */ DISABLED: 'DISABLED', - /** - * The resolved value was configured statically, or otherwise fell back to a pre-configured value. - */ - DEFAULT: 'DEFAULT', - /** * The reason for the resolved value could not be determined. */ UNKNOWN: 'UNKNOWN', /** - * The resolved value is static (no dynamic evaluation). + * The resolved value is non-authoritative or possibly out of date. */ - STATIC: 'STATIC', - - /** - * The resolved value was retrieved from cache. - */ - CACHED: 'CACHED', + STALE: 'STALE', /** * The resolved value was the result of an error.