Skip to content

feat: Add the FDv2 polling data source - #188

Open
beekld wants to merge 10 commits into
mainfrom
bklimt/SDK-2701/fdv2-polling
Open

feat: Add the FDv2 polling data source#188
beekld wants to merge 10 commits into
mainfrom
bklimt/SDK-2701/fdv2-polling

Conversation

@beekld

@beekld beekld commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds the first concrete FDv2 sources: a polling initializer and synchronizer, both built on the existing HttpTransport.

A few behaviors worth noting:

  • The synchronizer clamps its poll interval to a 30-second minimum.
  • Requests carry the standard authentication, application tag, and instance-id headers, and send the current selector as the request basis.
  • Recoverable HTTP statuses surface as interruptions and unrecoverable ones as terminal errors.

The source also reports an FDv1 fallback directive when a response signals one, which the orchestrator will act on in later work.

NOTE: This PR adds a direct dependency on percent-encoding, but this is low risk, because we already depend on that crate indirectly through other dependencies.


Note

Overview
Adds the first concrete FDv2 polling sources: a PollingInitializer and PollingSynchronizer that implement the existing Initializer / Synchronizer traits over HttpTransport.

Poll requests go to GET sdk/poll with shared RequestHeaders (auth, user-agent, instance id, optional tags) and an optional selector encoded as the basis query parameter via new URL helpers (percent-encoding dependency). The synchronizer waits between polls and clamps the interval to a 30s minimum.

Responses are mapped to FDv2SourceEvent: 304 yields a no-op change set; 200 bodies are parsed as FDv2 event envelopes through FDv2ProtocolHandler; recoverable HTTP errors become Interrupted, others TerminalError. FDv1 fallback directives are read from X-LD-FD-Fallback / TTL headers (with body precedence on goodbye), via new logic in source.rs.

Dev-only: tokio test-util for paused-clock interval tests; broad unit and mockito e2e coverage for parsing, status handling, selectors, and polling timing.

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

@beekld
beekld force-pushed the bklimt/SDK-2701/fdv2-polling branch 2 times, most recently from 51cd15e to e33f29d Compare August 10, 2026 18:46
@beekld
beekld force-pushed the bklimt/SDK-2701/fdv2-polling branch from e33f29d to 49a0ba3 Compare August 12, 2026 21:45
Base automatically changed from bklimt/SDK-2700/fdv2-source-traits to main August 12, 2026 22:10
@beekld
beekld force-pushed the bklimt/SDK-2701/fdv2-polling branch from 49a0ba3 to 03b9ff6 Compare August 12, 2026 22:10
@beekld
beekld marked this pull request as ready for review August 12, 2026 22:11
@beekld
beekld requested a review from a team as a code owner August 12, 2026 22:11
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