fix: Include the last data source error in provider error and stale events - #74
Draft
kinyoklion wants to merge 2 commits into
Draft
kinyoklion wants to merge 2 commits into
kinyoklion wants to merge 2 commits into
Conversation
…vents Co-Authored-By: rlamb@launchdarkly.com <4955475+kinyoklion@users.noreply.github.com>
Contributor
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
Co-Authored-By: rlamb@launchdarkly.com <4955475+kinyoklion@users.noreply.github.com>
This branch has not been deployed
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.
Requirements
Related issues
OFP requirements 4.2.3 / 4.2.4 (sdk-specs
OFP-openfeature-provider-behavior):STALE/ERRORevents MUST include the message of the last data source error, or a message describing the condition if it has none. The Java provider already does this.Describe the solution you've provided
Off(both inStatusChangeHandlerand theInitializeAsyncpre-check):PROVIDER_ERRORmessage and theLaunchDarklyProviderInitExceptionmessage now useDescribeLastError(status, ProviderShutdownMessage)instead of alwaysProviderShutdownMessage.Interrupted: previouslyLastError?.Message ?? "encountered an unknown error", so HTTP errors (which have noMessage) got the generic text; they now getErrorInfo.ToString()(e.g. kind + status code).Behavior is unchanged when there is no
LastError. Added tests for Off with an exception message, Off with an HTTP 401, Off with no error, and Interrupted with an HTTP 503.Describe alternatives you've considered
Always using
ErrorInfo.ToString()would also include the timestamp for exception-based errors;Messageis kept when present so existing Stale messages do not change.Additional context
Validated locally with
dotnet teston net8.0 (72 passed). Independent of the error-type PR (#73).Link to Devin session: https://app.devin.ai/sessions/929f5530882d40bc95e55391e97536d5
Open in Devin Desktop: https://app.devin.ai/desktop/session/929f5530882d40bc95e55391e97536d5?variant=devin
Requested by: @kinyoklion
SDK-3255