Skip to content

chore: Finish goodbye handling.#130

Merged
kinyoklion merged 2 commits intomainfrom
rlamb/connect-goodbye-reason
Feb 4, 2026
Merged

chore: Finish goodbye handling.#130
kinyoklion merged 2 commits intomainfrom
rlamb/connect-goodbye-reason

Conversation

@kinyoklion
Copy link
Member

@kinyoklion kinyoklion commented Feb 4, 2026

Note

Low Risk
Low risk: primarily adds logging and threads a reason string through GOODBYE status results; behavior changes are limited to observability and an extra status field.

Overview
FDv2 GOODBYE handling now captures and exposes the server-provided reason end-to-end: FDv2SourceResult.Status adds a reason field (with getReason()), and FDv2SourceResult.goodbye() now stores that reason instead of discarding it.

Both polling (PollingBase) and streaming (StreamingSynchronizerImpl) paths now log an info message when a goodbye is received and pass the extracted reason into FDv2SourceResult.goodbye(...). Tests are updated to assert reason is null for non-goodbye statuses and equals the expected string for goodbye events.

Written by Cursor Bugbot for commit b20c3c4. This will update automatically on new commits. Configure here.

@kinyoklion kinyoklion requested a review from a team as a code owner February 4, 2026 17:26
case GOODBYE:
return FDv2SourceResult.goodbye(((FDv2ProtocolHandler.FDv2ActionGoodbye) res).getReason(), fdv1Fallback);
String reason = ((FDv2ProtocolHandler.FDv2ActionGoodbye) res).getReason();
logger.info("Goodbye was received from the LaunchDarkly connection with reason: '{}'.", reason);
Copy link
Member Author

Choose a reason for hiding this comment

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


### Requirement 3.3.5
> The SDK **MUST** log the following message at the `info` level when a `goodbye` event is encountered. The message **MUST** include the reason.
>
> `Goodbye was received from the LaunchDarkly connection with reason: '{reason}'.`

this.reason = reason;
}

public static Status goodbye(String reason) {
Copy link
Member Author

Choose a reason for hiding this comment

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

Added these factories to make it a bit tidier in usage.

@kinyoklion kinyoklion merged commit 77c0a74 into main Feb 4, 2026
21 checks passed
@kinyoklion kinyoklion deleted the rlamb/connect-goodbye-reason branch February 4, 2026 19:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants