feat: Add dynamic URL support to ClientBuilder#143
Merged
Conversation
beekld
force-pushed
the
bklimt/SDK-2741/dynamic-uri
branch
from
July 22, 2026 17:50
1654ecf to
f4067f0
Compare
beekld
marked this pull request as ready for review
July 22, 2026 18:02
keelerm84
approved these changes
Jul 22, 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
Adds a way for callers to update the request URL between reconnects,
needed so FDv2 streaming can refresh the
basisquery param on eachreconnection.
ClientBuilder::dynamic_url(watch::Receiver<Uri>). Client readsthe current value at each connection attempt. If unset, uses the
existing
urlfield.Statevariants,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 likebasis). When set,resolve_url()reads the current watch value and overrides the staticfor_urlvalue;tokiogains thesyncfeature for the watch channel.Reconnect / redirect refactor:
ReconnectingRequestno longer keepscurrent_urlor a global redirect counter on the struct. EachNewconnect usesresolve_url(); redirect depth lives inState::Connecting/FollowingRedirect, and redirects issuesend_requestto theLocationURI directly instead of mutating a cached URL and re-enteringNew. 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.