From 31da456d953752522c557ee0b7cce7db7bba331e Mon Sep 17 00:00:00 2001 From: Todd Baert Date: Thu, 22 Feb 2024 15:26:10 -0500 Subject: [PATCH] fix: minor corrections around FATAL state (#247) No substantial changes here, just editorial improvements and corrections. When implementing https://github.com/open-feature/spec/pull/241, I noticed a few oversights (see comments). Signed-off-by: Todd Baert --- specification.json | 2 +- specification/sections/01-flag-evaluation.md | 2 +- specification/sections/05-events.md | 6 ++++-- specification/types.md | 1 + 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/specification.json b/specification.json index 78bbf147..1a3b3d31 100644 --- a/specification.json +++ b/specification.json @@ -340,7 +340,7 @@ { "id": "Requirement 1.7.7", "machine_id": "requirement_1_7_7", - "content": "The client MUST default, run error hooks, and indicate an error if flag resolution is attempted while the provider is in `PROVIDER_FATAL`.", + "content": "The client MUST default, run error hooks, and indicate an error if flag resolution is attempted while the provider is in `FATAL`.", "RFC 2119 keyword": "MUST", "children": [] }, diff --git a/specification/sections/01-flag-evaluation.md b/specification/sections/01-flag-evaluation.md index 493b1e07..db40c13f 100644 --- a/specification/sections/01-flag-evaluation.md +++ b/specification/sections/01-flag-evaluation.md @@ -493,7 +493,7 @@ see: [error codes](../types.md#error-code), [flag value resolution](./02-provide #### Requirement 1.7.7 -> The client **MUST** default, run error hooks, and indicate an error if flag resolution is attempted while the provider is in `PROVIDER_FATAL`. +> The client **MUST** default, run error hooks, and indicate an error if flag resolution is attempted while the provider is in `FATAL`. The client defaults and returns the `PROVIDER_FATAL` `error code` if evaluation is attempted after the provider has transitioned to an irrecoverable error state. The SDK avoids calling the provider's resolver functions entirely ("short-circuits") if the provider is in this state. diff --git a/specification/sections/05-events.md b/specification/sections/05-events.md index a6ebc5ad..16243d8c 100644 --- a/specification/sections/05-events.md +++ b/specification/sections/05-events.md @@ -229,9 +229,11 @@ The SDK must update it's internal representation of the provider's state accordi | -------------------------------- | ------------------------------------------------------- | | `PROVIDER_READY` | `READY` | | `PROVIDER_STALE` | `STALE` | -| `PROVIDER_ERROR` | `ERROR` | +| `PROVIDER_ERROR` | `ERROR`/`FATAL`* | | `PROVIDER_CONFIGURATION_CHANGED` | N/A (provider remains in its current state) | | `PROVIDER_CONTEXT_CHANGED` | N/A (only emitted by SDK during context reconciliation) | | `PROVIDER_RECONCILING` | N/A (only emitted by SDK during context reconciliation) | -see: [provider lifecycle management](01-flag-evaluation.md#17-provider-lifecycle-management) \ No newline at end of file +\* If the `error code` associated with the error indicates `PROVIDER_FATAL`, the state is set to `FATAL` + +see: [provider lifecycle management](01-flag-evaluation.md#17-provider-lifecycle-management), [provider status](../types.md#provider-status) [error codes](../types.md#error-code) \ No newline at end of file diff --git a/specification/types.md b/specification/types.md index 57189c80..bb7d340f 100644 --- a/specification/types.md +++ b/specification/types.md @@ -135,6 +135,7 @@ An enumeration of possible provider states. | READY | The provider has been initialized, and is able to reliably resolve flag values. | | ERROR | The provider is initialized but is not able to reliably resolve flag values. | | STALE | The provider's cached state is no longer valid and may not be up-to-date with the source of truth. | +| FATAL | The provider has entered an irrecoverable error state. | | RECONCILING* | The provider is reconciling its state with a context change. | \* [static context (client-side) paradigm](./glossary.md#static-context-paradigm) only