Skip to content

fix: FDv2 fixes surfaced by v3 contract test harness#547

Open
beekld wants to merge 9 commits into
mainfrom
beeklimt/contract-test-url-encoding
Open

fix: FDv2 fixes surfaced by v3 contract test harness#547
beekld wants to merge 9 commits into
mainfrom
beeklimt/contract-test-url-encoding

Conversation

@beekld
Copy link
Copy Markdown
Contributor

@beekld beekld commented Jun 4, 2026

FDv2 fixes for issues found running the v3 contract test harness against the server SDK.

  • Polling URL trailing-slash handling.
  • Filter key validation in FDv2 polling and streaming.
  • Protocol handler accepts incremental updates after payload-transferred.
  • Stream restart on parse failures and protocol errors.
  • Unknown SSE event types skipped without parsing.
  • Error events preserve protocol state (only accumulated changes cleared).

Note

Medium Risk
Changes core FDv2 sync behavior (multi-payload streams, error recovery, and reconnect triggers); mistakes could cause missed updates or extra reconnects, but scope is FDv2 data paths with expanded unit tests.

Overview
FDv2 protocol handler now matches streaming incremental semantics: after payload-transferred it stays active in kPartial instead of resetting, so later put/delete + payload-transferred cycles emit partial changesets without a new server-intent. Put/delete are no longer dropped solely because state was inactive; error clears in-flight changes but keeps protocol state so updates can continue. Adds IsKnownEvent for spec-defined ignore behavior.

Polling and streaming build /sdk/poll and /sdk/stream by stripping a trailing-slash empty URL segment (avoids //), and apply the same ValidateFilterKey used elsewhere—invalid filters are omitted with an error log and a full-environment request. MakeFDv2PollRequest takes a Logger for that path.

FDv2 streaming skips unknown SSE event types before JSON parsing, and calls async_restart on malformed JSON or non-server HandleEvent protocol errors so the next connection starts clean.

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

@beekld beekld force-pushed the beeklimt/contract-test-url-encoding branch from 1714aee to 3488e09 Compare June 4, 2026 23:51
@beekld beekld marked this pull request as ready for review June 4, 2026 23:53
@beekld beekld requested a review from a team as a code owner June 4, 2026 23:53
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.

1 participant