Bust stale generate picker catalog cache - #12
Merged
Conversation
Bump the selectable company groups unstable_cache key so the next production deploy drops the hour-old entry hiding newly approved products. Tag the cache and revalidate it from admin catalog writes and research-draft publish. Co-authored-by: Chinmay Kabi <chinmay@blend.to>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
This pull request has been ignored for the connected project Preview Branches by Supabase. |
Chinmay-KB
marked this pull request as ready for review
August 13, 2026 17:04
Move cache invalidation into a server-only module and keep grouping in a next/cache-free helper so generator-form no longer pulls revalidateTag into the client bundle. Co-authored-by: Chinmay Kabi <chinmay@blend.to>
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.
The
/generatepicker hid newly approved products for up to an hour becausegetSelectableCompanyGroupsusedunstable_cachewith keyselectable-company-groups-v2, a 1h TTL, and no tags. Deploys do not bust that Data Cache entry, and catalog writes never calledrevalidateTag.What changed
selectable-company-groups-v3so the next production deploy drops the stale entry (including Google’s missing M3 Expressive).selectable-company-groups.revalidateTag(..., { expire: 0 })) after admin company/product create, update, delete, and research-draft publish. No public revalidate endpoint.revalidateTaglives in a server-only module so client picker code does not import it (fixes the Site health build failure).researchStatus; Approve & Publish actually setsapprovedand busts the cache.research_status === "approved".revalidateTag. Future in-app approvals are covered.Test plan
yarn test— grouping: companies always selectable; products only when approvedyarn linton changed filesyarn build/ test / lint) green on6f7141f/generateon the next load