Skip to content

fix: Prevent polling from keeping a stale ETag after a response without one - #602

Merged
keelerm84 merged 1 commit into
mainfrom
mk/SDK-3791/clear-stale-polling-etag
Dec 1, 2026
Merged

keelerm84 merged 1 commit into
mainfrom
mk/SDK-3791/clear-stale-polling-etag

Conversation

@keelerm84

@keelerm84 keelerm84 commented Dec 1, 2026 •

Copy link
Copy Markdown
Member

Summary

The FDv2 polling requesters and the FDv1 fallback requesters, sync and async, kept the previous ETag when a 200 response had no ETag header. They then sent that old ETag in If-None-Match, so if the server's data returned to that earlier version, the server answered 304 and the SDK kept out-of-date data. Each requester now stores the ETag of every accepted response and clears it when the response has none. A response whose payload is rejected leaves the stored ETag unchanged.

Contract tests: launchdarkly/sdk-test-harness#704

Opened from termag


Note

Overview
Fixes stale ETag behavior in FDv2 and FDv1 fallback polling requesters (sync Urllib3* and async Aiohttp*).

ETag updates now run only when the polling payload is accepted (_Success). The stored value is set from every successful response and cleared when that response has no ETag, so the client does not keep sending If-None-Match for an old version after the server omits the header. Rejected payloads leave the previous ETag unchanged.

Adds test_polling_requester_etag.py with parametrized coverage for normal 304 behavior, clearing after a no-ETag 200, and preserving the ETag after invalid payloads.

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

…ut one

The FDv2 polling requesters and the FDv1 fallback requesters, sync and
async, kept the previous ETag when a 200 response had no ETag header.
They then sent that old ETag in If-None-Match. If the server data
returned to that earlier version, the server answered 304 and the SDK
kept out-of-date data.

Each requester now stores the ETag of every accepted response, and
clears it when the response has none. A response whose payload is
rejected leaves the stored ETag unchanged.

Generated-by: termag
@keelerm84
keelerm84 marked this pull request as ready for review December 1, 2026 16:53
@keelerm84
keelerm84 requested a review from a team as a code owner December 1, 2026 16:53

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Risk: low. Approved under SDK rules 1–3: not a release PR, author is an allowed SDK team member, and there are no GitHub Actions workflow changes. Cursor Bugbot completed with no findings that need human review.

Open in Web View Automation 

Sent by Cursor Approval Agent: SDK - Pull Request Router and Approver

@keelerm84
keelerm84 merged commit 6f92816 into main Dec 1, 2026
19 checks passed
@keelerm84
keelerm84 deleted the mk/SDK-3791/clear-stale-polling-etag branch December 1, 2026 18:06
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