fix: Include the last data source error in the provider error event - #59
Open
kinyoklion wants to merge 2 commits into
Open
fix: Include the last data source error in the provider error event#59kinyoklion wants to merge 2 commits into
kinyoklion wants to merge 2 commits into
Conversation
Co-Authored-By: rlamb@launchdarkly.com <4955475+kinyoklion@users.noreply.github.com>
Contributor
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
Contributor
|
@cursor review |
kinyoklion
marked this pull request as ready for review
August 27, 2026 22:00
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit dd39f2c. Configure here.
Co-Authored-By: rlamb@launchdarkly.com <4955475+kinyoklion@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

The
PROVIDER_ERRORevent now carries the last data source error instead of a fixed "Provider shutdown" message.PROVIDER_STALEbranch, which already reports the last error, and the wording used by the Python providerImplementation details
Found during the weekly OpenFeature provider audit against
launchdarkly/sdk-specs(OFP).handleDataSourceStatusdiscardedres.getLastError()in theOFFcase, so an application listening forPROVIDER_ERRORhad no way to see why the data source permanently failed (for example a401from an invalid SDK key). The state transition and initialization behavior are unchanged.The message is
ErrorInfo.toString(), notErrorInfo.getMessage():ErrorInfo.fromHttpErrorleaves the message null and records the failure as a kind plus a status code, sogetMessage()would emit a null message for exactly the HTTP failures this change is meant to surface.toString()is the SDK's own rendering of the kind, status code, and message.Requirements
Related issues
None.
Describe alternatives you've considered
Keeping the static message and adding the error as event metadata: OpenFeature only exposes a message on the event details, so the message is the right place for it.
Testing
./gradlew test checkstyleMain. Lifecycle tests cover a data source that fails after initialization with a kind/status/message error, and one that fails with an HTTP-only error, asserting the emitted message is non-empty and names the status code.Link to Devin session: https://app.devin.ai/sessions/38a6eaf69fcf41109e136a1d0fe5e899
Open in Devin Desktop: https://app.devin.ai/desktop/session/38a6eaf69fcf41109e136a1d0fe5e899?variant=devin
Requested by: @kinyoklion