feat: replace server-side Redis caching with TanStack Query AsyncStoragePersister

Consolidate two overlapping cache systems (broken TanStack persister + per-query Redis hash + pub/sub) into one: TanStack Query as single source of truth with Redis as its persistence layer via createAsyncStoragePersister.

- Replace QueryClientProvider with PersistQueryClientProvider backed by Redis
- Set global query defaults (staleTime: 0, refetchInterval: 30s, gcTime: 24h)
- Remove all per-widget staleTime/refetchInterval/retry/refetchOnWindowFocus overrides
- Replace cached request handlers with simplified fetch-only versions
- Remove all tRPC subscription procedures and useSubscription calls in favor of polling
- Delete 20 cron jobs that only pre-warmed server-side cache
- Simplify Redis from per-query hash to single blob per user+board
This commit is contained in:
Thomas Camlong committed 2026-06-24 14:55:17 +02:00
1 parent 58cb65cb3a
commit 6416080b79
165 files changed
+546 -3456

No files matched your search

+3 -10
View File
@@ -23,16 +23,9 @@ export default function AppWidget({ options, isEditMode, height, width }: Widget
const t = useI18n();
const settings = useSettings();
const board = useRequiredBoard();
const { data: app } = clientApi.app.byId.useQuery(
{
id: options.appId,
},
{
refetchOnWindowFocus: false,
refetchOnReconnect: false,
retry: false,
},
);
const { data: app } = clientApi.app.byId.useQuery({
id: options.appId,
});
useRegisterSpotlightContextResults(
`app-${app?.id ?? options.appId}`,
app?.href
@@ -13,17 +13,7 @@ export const PingIndicator = ({ appId }: PingIndicatorProps) => {
const t = useI18n();
const { data: pingResult } = clientApi.widget.app.ping.useQuery(
{ id: appId },
{ refetchOnMount: false, refetchOnWindowFocus: false },
);
const utils = clientApi.useUtils();
clientApi.widget.app.updatedPing.useSubscription(
{ id: appId },
{
onData(data) {
utils.widget.app.ping.setData({ id: appId }, data);
},
},
{ refetchOnMount: false },
);
if (!pingResult) return <PingDot icon={IconMinus} color="gray" tooltip={`${t("common.action.loading")}…`} />;