Skip to content

fix: Do not emit duplicate provider status events - #62

Draft
kinyoklion wants to merge 2 commits into
mainfrom
devin/1788360801-python-event-dedup
Draft

fix: Do not emit duplicate provider status events#62
kinyoklion wants to merge 2 commits into
mainfrom
devin/1788360801-python-event-dedup

Conversation

@kinyoklion

Copy link
Copy Markdown
Member

Requirements

  • I have added test coverage for new or changed functionality
  • I have followed the repository's pull request submission guidelines
  • I have validated my changes against all supported platform versions

Related issues

None.

Describe the solution you've provided

The LaunchDarkly data source reports a status change whenever its error information changes, so a data source which stays interrupted (for example, repeated request failures) produced a PROVIDER_STALE event per failure. The OpenFeature provider spec (OFP) requires a provider to emit a lifecycle event only when the provider status actually changes, so the provider now tracks the last data source state it emitted for and ignores a repeated state.

Implementation details

__handle_data_source_status consults __is_new_status, which records the state under a lock and reports whether it differs from the previously emitted one. INITIALIZING is still ignored before the check, so it cannot mask a later state.

This matches the behavior of the .NET provider, whose status provider already filters unchanged statuses.

Describe alternatives you've considered

Comparing the mapped OpenFeature provider status rather than the data source state. The two are one-to-one here, and comparing states keeps the mapping in a single place.

Additional context

make lint and make test pass (85 tests). The README feature matrix eventing row now records that events are emitted only on a status change.

Link to Devin session: https://app.devin.ai/sessions/fe1eb757fe694ef79f3d09f6307d4b47
Open in Devin Desktop: https://app.devin.ai/desktop/session/fe1eb757fe694ef79f3d09f6307d4b47?variant=devin
Requested by: @kinyoklion

Signed-off-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: rlamb@launchdarkly.com <4955475+kinyoklion@users.noreply.github.com>
@devin-ai-integration

Copy link
Copy Markdown
Contributor

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment, CI, and merge conflict monitoring

@devin-ai-integration devin-ai-integration Bot added the devin-pr Pull request created by Devin AI label Sep 2, 2026
@devin-ai-integration

Copy link
Copy Markdown
Contributor

@cursor review

Signed-off-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: rlamb@launchdarkly.com <4955475+kinyoklion@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

devin-pr Pull request created by Devin AI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant