diff --git a/packages/trpc/src/router/device/device.ts b/packages/trpc/src/router/device/device.ts index 3a2478252bb..cc5da7e7594 100644 --- a/packages/trpc/src/router/device/device.ts +++ b/packages/trpc/src/router/device/device.ts @@ -10,54 +10,6 @@ import { protectedProcedure } from "../../trpc"; * the rest of v1. */ export const deviceRouter = { - /** - * @deprecated Kept for backwards compat with shipped desktop/mobile clients - * that still call heartbeat on a 30s interval. Same logic as registerDevice. - */ - heartbeat: protectedProcedure - .input( - z.object({ - deviceId: z.string().min(1), - deviceName: z.string().min(1), - deviceType: z.enum(deviceTypeValues), - }), - ) - .mutation(async ({ ctx, input }) => { - const organizationId = ctx.activeOrganizationId; - if (!organizationId) { - throw new TRPCError({ - code: "BAD_REQUEST", - message: "No active organization selected", - }); - } - - const userId = ctx.session.user.id; - const now = new Date(); - - await db - .insert(devicePresence) - .values({ - userId, - organizationId, - deviceId: input.deviceId, - deviceName: input.deviceName, - deviceType: input.deviceType, - lastSeenAt: now, - createdAt: now, - }) - .onConflictDoUpdate({ - target: [devicePresence.userId, devicePresence.deviceId], - set: { - deviceName: input.deviceName, - deviceType: input.deviceType, - lastSeenAt: now, - organizationId, - }, - }); - - return { success: true }; - }), - /** * Register device presence (called once on app startup). * Upserts a row so MCP can verify device ownership.