-
Notifications
You must be signed in to change notification settings - Fork 21
chore: enable/specify http snippets with docs.yml setting #4024
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: app
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for GitHub.
|
const flags = await flagsPromise; | ||
const settings = await getSettings(cacheConfig)(domainKey); | ||
return await backfillSnippets({ | ||
apiDefinition: cached, | ||
dynamicIr, | ||
httpSnippets: settings.httpSnippets ?? flags.isHttpSnippetsEnabled, | ||
alwaysEnableJavaScriptFetch: flags.alwaysEnableJavaScriptFetch | ||
}); | ||
} | ||
} | ||
} catch (error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Potential bug: The revalidation route does not call backfillSnippets
, unlike the fresh API load path, causing inconsistent HTTP snippet generation depending on cache state.
-
Description: The
createGetPrunedApiCached
function was updated to callbackfillSnippets
to enrich API definitions with HTTP snippets. However, the corresponding revalidation route was not updated and does not callbackfillSnippets
. This creates a data inconsistency where API documentation will have HTTP snippets on a fresh load but will be missing them when served from a revalidated cache. This leads to an inconsistent user experience where snippets appear or disappear depending on the cache state, violating an explicit repository guideline to keep these two code paths in sync. -
Suggested fix: Update the revalidation route to also call
backfillSnippets
when creating the pruned API definition. This will ensure that both the fresh load path and the revalidation path apply the same snippet enrichment logic, maintaining data consistency across cache states.
severity: 0.75, confidence: 0.95
Did we get this right? 👍 / 👎 to inform future reviews.
we will be deprecating the edge config flag in favor of the docs setting soon