Repository navigation
Conversation
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
Reduce bandwidth on warm
/featuresrefreshes using the origin's existing ETag support, without adding an HTTP cache or a new dependency.If-None-Matchon ordinary refreshes. Treat a bodyless 304 as successful revalidation: retain definitions/evaluators/version and reset freshness, without recompiling or saving a fallback snapshot.HttpClientResponse.etagmetadata; existing custom clients without an ETag continue using full GETs. The default transport readsresponse.headers.get("etag")directly, with no full header copy or case-insensitive record scan. It preservesok: falseon 304 and does not parse its empty body.waitForVersionrequests unconditional. Recover once from an unexpected unconditional 304, preserve validators after failed/rejected refreshes, and clear them on replacement without an ETag or destruction.Coverage
Regression tests cover 200 → repeated 304 → changed 200, default and custom HTTP clients, exact weak ETags, empty definitions, missing ETags, malformed/older/error responses, per-client isolation, fallback startup, bounded unexpected-304 recovery, version-targeted refreshes, a pending newer version during revalidation, polling, edge/request-driven TTL, and push reconnects. Includes a real loopback HTTP conditional GET test, transient fallback-save recovery, nonblocking pending saves, and guards against late saves modifying a newer or destroyed cache. Also covers v2 → rejected v1 → 304 without overwriting the v2 fallback snapshot, late saves completing after snapshot replacement/destruction, independent validators when snapshots share a definitions array, preservation of pending version targets when a plain refresh arrives, only one unexpected-304 recovery across ordinary retries, and ordered background persistence when an older save is delayed or fails, with subsequent 304s retaining the latest stored flags.
Validation
--skipLibCheck; the full local build process was terminated before completion.git diff --checkpassed.Local tooling caveat:
yarn install --immutabletimed out during dependency fetching, so local checks use the existing installed toolchain (Node 24.14.0 / Vitest 3.2.6). The initial OpenFeature provider checks hit a Vitest 3 constructor-mock incompatibility also reproduced on the unchanged original branch; full CI subsequently passed with the locked toolchain. No provider code or dependency versions are changed here.Scope
No server changes or new configuration are required. This avoids unchanged warm-refresh bodies, not origin requests or full downloads for cold processes/Worker isolates. Version-wait semantics remain unchanged.