From 3e74f9a374a2354540a36fc5020d95d586af3871 Mon Sep 17 00:00:00 2001 From: Mauricio Siu <47042324+Siumauricio@users.noreply.github.com> Date: Sun, 5 Jul 2026 15:01:21 -0600 Subject: [PATCH] fix(user): scope user.get relation columns to reduce SSR payload size (#4730) apiKeys and nested user were returned without column projection, shipping secrets (key, permissions, metadata) and unused fields to every page that prefetches user.get, causing the /dashboard/home SSR payload to exceed Next.js's 128kB warning threshold. --- apps/dokploy/server/api/routers/user.ts | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/apps/dokploy/server/api/routers/user.ts b/apps/dokploy/server/api/routers/user.ts index fc3b29d6e..583014ff6 100644 --- a/apps/dokploy/server/api/routers/user.ts +++ b/apps/dokploy/server/api/routers/user.ts @@ -137,8 +137,31 @@ export const userRouter = createTRPCRouter({ ), with: { user: { + columns: { + id: true, + firstName: true, + lastName: true, + email: true, + image: true, + allowImpersonation: true, + twoFactorEnabled: true, + stripeCustomerId: true, + stripeSubscriptionId: true, + serversQuantity: true, + isEnterpriseCloud: true, + sendInvoiceNotifications: true, + }, with: { - apiKeys: true, + apiKeys: { + columns: { + id: true, + name: true, + prefix: true, + enabled: true, + expiresAt: true, + createdAt: true, + }, + }, }, }, },