Skip to content

Commit

Permalink
fix: minor corrections around FATAL state (#247)
Browse files Browse the repository at this point in the history
No substantial changes here, just editorial improvements and
corrections.

When implementing #241, I
noticed a few oversights (see comments).

Signed-off-by: Todd Baert <[email protected]>
  • Loading branch information
toddbaert authored Feb 22, 2024
1 parent ae286cf commit 31da456
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion specification.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": []
},
Expand Down
2 changes: 1 addition & 1 deletion specification/sections/01-flag-evaluation.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
6 changes: 4 additions & 2 deletions specification/sections/05-events.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
\* 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)
1 change: 1 addition & 0 deletions specification/types.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 31da456

Please sign in to comment.