Skip to content

fix: align FDv2 goodbye event with spec (reason-only)#422

Merged
keelerm84 merged 1 commit intomainfrom
mk/sdk-2295/remove-cat-silence
Apr 30, 2026
Merged

fix: align FDv2 goodbye event with spec (reason-only)#422
keelerm84 merged 1 commit intomainfrom
mk/sdk-2295/remove-cat-silence

Conversation

@keelerm84
Copy link
Copy Markdown
Member

@keelerm84 keelerm84 commented Apr 30, 2026

Summary

  • The FDv2 goodbye event is specified to carry only a reason field. The Python SDK's Goodbye dataclass incorrectly declared silent and catastrophe, and from_dict raised ValueError if either was missing — meaning a spec-compliant payload would fail to parse.
  • This PR removes both fields from the dataclass and from to_dict/from_dict. from_dict now requires only reason.
  • Streaming consumer in ldclient/impl/datasourcev2/streaming.py was logging at log.error and reading goodbye.silent / goodbye.catastrophe. Replaced with a single log.info("SSE server sent goodbye: %s", goodbye.reason) — a goodbye is a normal protocol signal, matching what the Java SDK does.

Test plan

  • poetry run pytest ldclient/testing/impl/datasourcev2/ — 71 tests pass.
  • poetry run pytest ldclient/testing/ — full unit test suite (1161 tests) passes.
  • grep -rn "silent\|catastrophe" ldclient/ — no remaining references.

Note

Low Risk
Low risk: change is limited to FDv2 Goodbye event serialization/parsing and corresponding log/test updates, with no new behavior beyond accepting spec-compliant payloads and adjusting log level.

Overview
Aligns the FDv2 Goodbye event with the spec by removing the silent and catastrophe fields from the Goodbye dataclass and its to_dict/from_dict methods, so parsing no longer fails on reason-only payloads.

Updates the streaming SSE consumer to treat GOODBYE as a normal protocol signal (logs info with the reason only) and adjusts datasourcev2 polling/streaming tests to construct Goodbye with just reason.

Reviewed by Cursor Bugbot for commit c1eb5cc. Bugbot is set up for automated code reviews on this repo. Configure here.

The FDv2 goodbye event is specified to carry only a `reason` field, but
the `Goodbye` dataclass declared `silent` and `catastrophe` and
`from_dict` raised `ValueError` if any of the three were missing. This
meant a spec-compliant payload would fail to parse.

Drop `silent` and `catastrophe` from the dataclass and require only
`reason` when deserializing. Update the streaming handler to log the
reason unconditionally rather than gating on `silent` / formatting with
`catastrophe`. Update test fixtures accordingly.
@keelerm84 keelerm84 requested a review from a team as a code owner April 30, 2026 15:21
@keelerm84 keelerm84 merged commit 84b442d into main Apr 30, 2026
17 checks passed
@keelerm84 keelerm84 deleted the mk/sdk-2295/remove-cat-silence branch April 30, 2026 16:09
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