Skip to content

fix: Poll for flag updates when the stream sends a ping event - #647

Draft
kinyoklion wants to merge 3 commits into
mainfrom
rlamb/sdk-3657/client-ping-polls
Draft

kinyoklion wants to merge 3 commits into
mainfrom
rlamb/sdk-3657/client-ping-polls

Conversation

@kinyoklion

@kinyoklion kinyoklion commented Nov 17, 2026 •

Copy link
Copy Markdown
Member

The client SDK ignored the "ping" event, which the Relay Proxy can send in place of flag data, so it did not get the changed flags. On a ping, the streaming data source now polls for the current context with the configured method (REPORT or GET) and reasons setting, and applies the result as a full data set.

One ping poll runs at a time. A ping that arrives during a poll causes one more poll after it completes, so the newest data is applied last and a burst of pings costs at most two polls. A poll result that arrives after shutdown, or after the stream stops on an unrecoverable error, is discarded. A failed poll sets the Interrupted state, the stream stays open, and the next ping polls again. As in the other SDKs, a failed poll is not retried, so a failed first poll leaves the SDK initializing until the next ping. An HTTP 401 or 403 on the poll does not shut the data source down, as in the JS and Android SDKs.

Testing: With Beast and with CURL, new unit tests cover GET, REPORT, reasons, pings during a poll, an error status, a network error, and a poll that completes after shutdown or after the stream stops. They fail without the change. The two harness ping tests change from fail to pass, and the full client contract suite shows no other change.

SDK-3657

Opened from termag

This branch has not been deployed

No deployments
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