Skip to content

feat: Add dynamic URL support to ClientBuilder#143

Merged
beekld merged 1 commit into
mainfrom
bklimt/SDK-2741/dynamic-uri
Jul 22, 2026
Merged

feat: Add dynamic URL support to ClientBuilder#143
beekld merged 1 commit into
mainfrom
bklimt/SDK-2741/dynamic-uri

Conversation

@beekld

@beekld beekld commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds a way for callers to update the request URL between reconnects,
needed so FDv2 streaming can refresh the basis query param on each
reconnection.

  • New ClientBuilder::dynamic_url(watch::Receiver<Uri>). Client reads
    the current value at each connection attempt. If unset, uses the
    existing url field.
  • Moves redirect state out of struct fields and into State variants,
    to avoid quasi-global state between the URL source and the redirect
    flow. Semantics-preserving.

Note

Medium Risk
Touches core connect/reconnect and HTTP redirect logic; behavior is intended to be equivalent but URL resolution timing changed for redirects vs dynamic URLs.

Overview
Adds ClientBuilder::dynamic_url(watch::Receiver<Uri>) so callers can change the SSE endpoint on every connect and reconnect (e.g. refresh query params like basis). When set, resolve_url() reads the current watch value and overrides the static for_url value; tokio gains the sync feature for the watch channel.

Reconnect / redirect refactor: ReconnectingRequest no longer keeps current_url or a global redirect counter on the struct. Each New connect uses resolve_url(); redirect depth lives in State::Connecting / FollowingRedirect, and redirects issue send_request to the Location URI directly instead of mutating a cached URL and re-entering New. Redirect limit behavior is preserved with tests for 301 follow, limit exceeded, and redirect vs dynamic URL precedence.

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

@beekld
beekld force-pushed the bklimt/SDK-2741/dynamic-uri branch from 1654ecf to f4067f0 Compare July 22, 2026 17:50
@beekld
beekld marked this pull request as ready for review July 22, 2026 18:02
@beekld
beekld requested a review from a team as a code owner July 22, 2026 18:02
@beekld
beekld merged commit ee31578 into main Jul 22, 2026
15 of 16 checks passed
@beekld
beekld deleted the bklimt/SDK-2741/dynamic-uri branch July 22, 2026 19:38
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