FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

fix: Include the last data source error in the provider error event by kinyoklion · Pull Request #59 · launchdarkly/openfeature-java-server · GitHub

fix: Include the last data source error in the provider error event - #59

Open
kinyoklion wants to merge 2 commits into
mainfrom
devin/1787755583-java-provider-error-message
Open

fix: Include the last data source error in the provider error event#59
kinyoklion wants to merge 2 commits into
mainfrom
devin/1787755583-java-provider-error-message

Conversation

kinyoklion commented Aug 26, 2026
edited by devin-ai-integration Bot
Loading

Copy link
Copy Markdown
Member

The PROVIDER_ERROR event now carries the last data source error instead of a fixed "Provider shutdown" message.

  • Matches the OFP spec, which requires the error event to report the last data source error, with a description as a fallback
  • Matches the PROVIDER_STALE branch, which already reports the last error, and the wording used by the Python provider
Implementation details

Found during the weekly OpenFeature provider audit against launchdarkly/sdk-specs (OFP).

handleDataSourceStatus discarded res.getLastError() in the OFF case, so an application listening for PROVIDER_ERROR had no way to see why the data source permanently failed (for example a 401 from an invalid SDK key). The state transition and initialization behavior are unchanged.

The message is ErrorInfo.toString(), not ErrorInfo.getMessage(): ErrorInfo.fromHttpError leaves the message null and records the failure as a kind plus a status code, so getMessage() 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

  • 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 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

Co-Authored-By: rlamb@launchdarkly.com <4955475+kinyoklion@users.noreply.github.com>

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

Copy link
Copy Markdown
Contributor

@cursor review

kinyoklion marked this pull request as ready for review August 27, 2026 22:00
kinyoklion requested a review from a team as a code owner August 27, 2026 22:00

cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants


Back | FazBrowse Home | New Git URL