Skip to content

Bust stale generate picker catalog cache - #12

Merged
Chinmay-KB merged 2 commits into
mainfrom
cursor/bust-selectable-catalog-cache-26d1
Aug 13, 2026
Merged

Bust stale generate picker catalog cache#12
Chinmay-KB merged 2 commits into
mainfrom
cursor/bust-selectable-catalog-cache-26d1

Conversation

@Chinmay-KB

@Chinmay-KB Chinmay-KB commented Aug 13, 2026

Copy link
Copy Markdown
Owner

The /generate picker hid newly approved products for up to an hour because getSelectableCompanyGroups used unstable_cache with key selectable-company-groups-v2, a 1h TTL, and no tags. Deploys do not bust that Data Cache entry, and catalog writes never called revalidateTag.

What changed

  • Bumped the cache key to selectable-company-groups-v3 so the next production deploy drops the stale entry (including Google’s missing M3 Expressive).
  • Tagged the picker cache (and the feed filter cache that wraps it) as selectable-company-groups.
  • Revalidate that tag immediately (revalidateTag(..., { expire: 0 })) after admin company/product create, update, delete, and research-draft publish. No public revalidate endpoint.
  • revalidateTag lives in a server-only module so client picker code does not import it (fixes the Site health build failure).
  • Admin product PUT now accepts researchStatus; Approve & Publish actually sets approved and busts the cache.
  • Grouping stays the same: companies are always selectable; products only when research_status === "approved".
  • CLI import script is out of process, so it cannot call revalidateTag. Future in-app approvals are covered.

Test plan

  • yarn test — grouping: companies always selectable; products only when approved
  • yarn lint on changed files
  • Site health CI (yarn build / test / lint) green on 6f7141f
  • After merge + deploy, https://xbuildsy.com/generate lists M3 Expressive under Google without waiting out the old 1h TTL
  • Approving another product in admin (or publishing a research draft) shows it on /generate on the next load
Open in Web Open in Cursor 

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>
@vercel

vercel Bot commented Aug 13, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
if-x-built-y Ready Ready Preview Aug 13, 2026 5:09pm

@supabase

supabase Bot commented Aug 13, 2026

Copy link
Copy Markdown

This pull request has been ignored for the connected project bjsepxonrrnwwxaejkrv because there are no changes detected in supabase directory. You can change this behaviour in Project Integrations Settings ↗︎.


Preview Branches by Supabase.
Learn more about Supabase Branching ↗︎.

@Chinmay-KB
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>
@Chinmay-KB
Chinmay-KB merged commit 1332fa6 into main Aug 13, 2026
4 checks passed
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.

2 participants