From 16344b06e85100c0485ec14dce950ecc0316fbcf Mon Sep 17 00:00:00 2001 From: Theodore Li Date: Fri, 17 Jul 2026 12:18:53 -0700 Subject: [PATCH] fix(oauth): serialize version-guard date in slack fan-out sql --- apps/sim/lib/oauth/slack.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/apps/sim/lib/oauth/slack.ts b/apps/sim/lib/oauth/slack.ts index 25f5811859c..9c69ed3c887 100644 --- a/apps/sim/lib/oauth/slack.ts +++ b/apps/sim/lib/oauth/slack.ts @@ -77,7 +77,9 @@ export async function fanOutSlackTokenChain( and( installationFilter(teamId), since - ? sql`NOT EXISTS (SELECT 1 FROM ${account} sibling WHERE sibling.provider_id = 'slack' AND sibling.account_id LIKE ${`${teamId}-%`} AND sibling.updated_at > ${since})` + ? // Raw sql params skip drizzle's column mapping, and the driver + // rejects bare Date objects — serialize to ISO explicitly. + sql`NOT EXISTS (SELECT 1 FROM ${account} sibling WHERE sibling.provider_id = 'slack' AND sibling.account_id LIKE ${`${teamId}-%`} AND sibling.updated_at > ${since.toISOString()})` : undefined ) )