Skip to content

fix(yir): refetch the persona when the VIP status changes - #3632

Draft
vladjerca wants to merge 1 commit into
mainfrom
feat/yir-persona-refetch
Draft

vladjerca wants to merge 1 commit into
mainfrom
feat/yir-persona-refetch

Conversation

@vladjerca

Copy link
Copy Markdown
Contributor

Loads the Year in Review persona for a free user right after they buy VIP, without a manual reload.

What changed

  • yirPersonaQuery now lists InvalidateAction.Vip.Updated in its invalidations. The checkout confirmation already fires that action, so the mounted persona query refetches. This is the same approach the Reality Check queries use.
  • Before this, the refused request for a free user was cached as an empty result and kept for the query's lifetime.

Tests

  • yirPersonaQuery.spec.ts asserts the query key carries the VIP update action (same style as the Reality Check query specs).
  • Scoped run: 1 file, 1 test passed (bun run test:unit --run src/lib/requests/queries/users/yirPersonaQuery).
  • Type check shows no errors in the touched files (120 existing errors elsewhere, unchanged). ESLint and Biome format are clean on the touched files.

Not verified

  • A real purchase on the page. The refetch relies on the existing checkout confirmation firing the VIP update action.

The persona request is refused for free users and the empty result was
cached, so a buyer saw no persona until a manual reload. Invalidate the
query on a VIP update, as the Reality Check queries already do.
@vladjerca
vladjerca requested a review from seferturan October 24, 2026 19:48
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