Bug
In apps/dashboard/app/(main)/websites/[id]/flags/_components/flags-list.tsx, both StatusToggle and FlagActions invalidate the flag list query after a successful mutation using:
queryClient.invalidateQueries({
queryKey: orpc.flags.list.key({
input: { websiteId: flag.websiteId ?? "" },
}),
});
But the page's list query is keyed with the route param (page.tsx):
useQuery({
...orpc.flags.list.queryOptions({ input: { websiteId } }), // websiteId = route param
});
oRPC / React Query invalidation matches keys element-wise. For any flag whose websiteId is null, the invalidation key carries websiteId: "" and never matches the cached entry — so after toggling or archiving a flag, the list keeps showing stale status until a manual page refresh.
Current reachability
Today this is latent: the flags page only lists website-scoped flags (the RPC list filter is eq(flags.websiteId, input.websiteId)), so every row has a matching websiteId. It becomes live as soon as:
- org-scoped flags are rendered in this component, or
- the list schema starts returning hybrid rows.
Suggested fix
Thread the real websiteId from the route into FlagsList → FlagRow → StatusToggle/FlagActions and use it for invalidation instead of flag.websiteId ?? "".
Bug
In
apps/dashboard/app/(main)/websites/[id]/flags/_components/flags-list.tsx, bothStatusToggleandFlagActionsinvalidate the flag list query after a successful mutation using:But the page's list query is keyed with the route param (
page.tsx):oRPC / React Query invalidation matches keys element-wise. For any flag whose
websiteIdisnull, the invalidation key carrieswebsiteId: ""and never matches the cached entry — so after toggling or archiving a flag, the list keeps showing stale status until a manual page refresh.Current reachability
Today this is latent: the flags page only lists website-scoped flags (the RPC list filter is
eq(flags.websiteId, input.websiteId)), so every row has a matchingwebsiteId. It becomes live as soon as:Suggested fix
Thread the real
websiteIdfrom the route intoFlagsList→FlagRow→StatusToggle/FlagActionsand use it for invalidation instead offlag.websiteId ?? "".