You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(persona-quiz): pass tag filter as Feed variables so preview actually renders
The previous attempt routed the inter-question preview through the user's
persisted `feedSettings` and relied on cache invalidation to trigger refetches
after each `followTags` call. Two problems with that:
1. `feedQueryKey = [RequestKey.FeedPreview, user.id]` doesn't change when
tags change, so React Query happily serves stale cache.
2. The shared `Feed` component supports a `variables` prop that gets spread
into the GraphQL request — pass the tag filter explicitly and you don't
need cache invalidation at all.
Switching to the variables approach:
- Pass `variables={{ filters: { includeTags: previewTags } }}` to `Feed`
- Add the tag list to `feedQueryKey` so each unique tag set is its own
cache entry and re-renders fetch fresh posts
- Remove the incremental `followTags` + debounced `refetchPreview` block
and the unused `useQueryClient` / `useDebounceFn` imports
- Restore the single `followTags(merged)` call at the end of `finishQuiz`
so the reveal screen's `TagSelection` sees the quiz tags as already
followed via `feedSettings`
Net: fewer moving parts, the preview now refreshes deterministically as
the user answers, and the reveal flow is unchanged.
Tests still 4/4 pass; typecheck and lint clean.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
0 commit comments