fix: align FDv2 goodbye event with spec (reason-only)#422
Merged
Conversation
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.
kinyoklion
approved these changes
Apr 30, 2026
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.
Summary
goodbyeevent is specified to carry only areasonfield. The Python SDK'sGoodbyedataclass incorrectly declaredsilentandcatastrophe, andfrom_dictraisedValueErrorif either was missing — meaning a spec-compliant payload would fail to parse.to_dict/from_dict.from_dictnow requires onlyreason.ldclient/impl/datasourcev2/streaming.pywas logging atlog.errorand readinggoodbye.silent/goodbye.catastrophe. Replaced with a singlelog.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
Goodbyeevent serialization/parsing and corresponding log/test updates, with no new behavior beyond accepting spec-compliant payloads and adjusting log level.Overview
Aligns the FDv2
Goodbyeevent with the spec by removing thesilentandcatastrophefields from theGoodbyedataclass and itsto_dict/from_dictmethods, so parsing no longer fails on reason-only payloads.Updates the streaming SSE consumer to treat
GOODBYEas a normal protocol signal (logsinfowith the reason only) and adjusts datasourcev2 polling/streaming tests to constructGoodbyewith justreason.Reviewed by Cursor Bugbot for commit c1eb5cc. Bugbot is set up for automated code reviews on this repo. Configure here.