[BUG] a FATAL provider does not run newly registered PROVIDER_ERROR handlers immediately
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 78/100
Research direction
Start in openfeature/event_executor.go at emitOnRegistration and compare its state/event mappings with stateFromEvent in openfeature/openfeature_api.go. Add coverage for registering a PROVIDER_ERROR handler after a PROVIDER_ERROR with PROVIDER_FATAL has moved the provider to FATAL, then run the relevant Go tests; done means the handler fires immediately.
Written by the indexing model from the issue text.
Description
Observed behavior
emitOnRegistration matches only three state/event pairs — READY/ProviderReady, ERROR/ProviderError, STALE/ProviderStale:
There is no FatalState branch, even though stateFromEvent can produce it:
So a handler attached while the provider is FATAL never fires:
state after fatal error event = "FATAL"
error handler fired immediately on registration while FATAL = false
Expected Behavior
Per 5.3.3: "Handlers attached after the provider is already in the associated state, MUST run immediately." Combined with 1.7.5 (FATAL results from a PROVIDER_ERROR carrying PROVIDER_FATAL), a FATAL provider should fire PROVIDER_ERROR handlers on registration.
Two of the three siblings map FATAL → error for this purpose:
- JS —
[AllProviderStatus.FATAL]: AllProviderEvents.Errorinevent-utils.ts. - Python —
ProviderStatus.FATAL: ProviderEvent.PROVIDER_ERRORin_event_support.py.
For fairness: Java is also missing it (ProviderState.matchesEvent omits FATAL), so Go isn't alone here — but the spec plus the JS/Python behaviour support the fix.
Possibly worth folding in
While in this function: emitOnRegistration hardcodes Message (e.g. "provider is in ready state") and drops ErrorCode, FlagChanges and EventMetadata from the event that actually caused the state.
The siblings also synthesize minimal details at this point, so this isn't a deviation on its own. But per 5.1.5 (PROVIDER_ERROR events SHOULD populate the error code), propagating at least ErrorCode would be an improvement — and fabricating a message where siblings leave the field unset is arguably worse than leaving it empty. Happy to split this out if preferred.
Steps to reproduce
// drive a provider to FATAL by emitting PROVIDER_ERROR with ErrorCode = of.ProviderFatalCode
fired := false
cb := func(d of.EventDetails) { fired = true }
api.AddHandler(of.ProviderError, &cb)
// client.State() == "FATAL", but fired == false
- Dominant language
- Go
- Stars
- 251
- Forks
- 62
- Avg merge
- 2d 3h
- Merged PRs (30d)
- 25
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from open-feature/go-sdk
-
[BUG] evaluate() returns errors without an ErrorCode or Reason on the UTF-8 and before-hook paths Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
open-feature/go-sdk#567 ·
-
[BUG] telemetry: feature_flag.context.id is emitted as an empty string when no targeting key is set Openbug good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
open-feature/go-sdk#563 ·
-
bug multi-provider Needs Triage
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
open-feature/go-sdk#560 ·
-
bug Needs Triage
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
open-feature/go-sdk#558 ·
-
[BUG] FlagMetadata is handed out by reference, so hooks and applications can mutate provider state Openbug Needs Triage
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
open-feature/go-sdk#556 ·
All issues in open-feature/go-sdk
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 84/100
-
enhancement needs triage
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
kind/cleanup
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
kubernetes-sigs/kueue#15947 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
sympozium-ai/sympozium#627 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100