Conversation
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
| if (res.ok) { | ||
| return res.json() as Promise<BundledDefinitions>; | ||
| const data = (await res.json()) as BundledDefinitions; | ||
| return { ...data, fetchedAt: Date.now() }; |
Contributor
This branch was successfully deployed
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.
Context
Follow-up to #498 (comment).
This PR is stacked on #498 (
flags-version-header), which is still open, so the diff contains only the timestamp/freshness follow-up. Retarget tomainafter #498 merges.Changes
fetchedAtmetadata, stamped locally after build-time preparation, runtime HTTP fetches, and stream data receipt.fetchedAt, scoped to the current data object. Older headers do not extend freshness.New configurable stale-while-revalidate/stale-if-error APIs are intentionally left for later; fallback-on-error behavior is unchanged.
Verification
All final checks exited 0:
pnpm -C packages/vercel-flags-core exec vitest run --exclude src/integration.test.ts— 589 tests passed across 15 files.pnpm -C packages/prepare-flags-definitions test— 23 tests passed.pnpm -C packages/prepare-flags-definitions type-checkpnpm -C packages/vercel-flags-core type-checkpnpm exec biome check packages/vercel-flags-core/src/controller/{index.ts,header-source.ts,header-source.test.ts,fetch-datafile.ts,stream-source.ts} packages/vercel-flags-core/src/{types.ts,vercel-mode.black-box.test.ts,black-box.test.ts} packages/prepare-flags-definitions/src/{index.ts,index.test.ts}— 10 files checked, no fixes needed.git diff --checkandgit diff --cached --checkLive integration tests were not run. Existing usage-tracker retry tests emitted their simulated network-error logs while passing. Biome's
--changed --since=HEADshortcut found no files in this worktree; the explicit-file check above passed instead.