Skip to content

Conversation

chdeskur
Copy link
Collaborator

@chdeskur chdeskur commented Oct 8, 2025

we will be deprecating the edge config flag in favor of the docs setting soon

Copy link
Contributor

vercel bot commented Oct 8, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Updated (UTC)
dev.ferndocs.com Canceled Canceled Oct 8, 2025 3:54am
fern-dashboard Ready Ready Preview Oct 8, 2025 3:54am
fern-dashboard-dev Canceled Canceled Oct 8, 2025 3:54am
ferndocs.com Ready Ready Preview Oct 8, 2025 3:54am
preview.ferndocs.com Canceled Canceled Oct 8, 2025 3:54am
prod-assets.ferndocs.com Ready Ready Preview Oct 8, 2025 3:54am
prod.ferndocs.com Canceled Canceled Oct 8, 2025 3:54am

Comment on lines +478 to 488
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) {
Copy link

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 call backfillSnippets to enrich API definitions with HTTP snippets. However, the corresponding revalidation route was not updated and does not call backfillSnippets. 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.

@chdeskur
Copy link
Collaborator Author

chdeskur commented Oct 8, 2025

Screenshot 2025-10-07 at 11 12 30 PM

@chdeskur
Copy link
Collaborator Author

chdeskur commented Oct 8, 2025

Screenshot 2025-10-07 at 11 23 52 PM

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