Skip to content

Commit c9399f8

Browse files
fix(oauth): serialize version-guard date in slack fan-out sql (#5737)
1 parent 61de0b5 commit c9399f8

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

apps/sim/lib/oauth/slack.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,9 @@ export async function fanOutSlackTokenChain(
7777
and(
7878
installationFilter(teamId),
7979
since
80-
? sql`NOT EXISTS (SELECT 1 FROM ${account} sibling WHERE sibling.provider_id = 'slack' AND sibling.account_id LIKE ${`${teamId}-%`} AND sibling.updated_at > ${since})`
80+
? // Raw sql params skip drizzle's column mapping, and the driver
81+
// rejects bare Date objects — serialize to ISO explicitly.
82+
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()})`
8183
: undefined
8284
)
8385
)

0 commit comments

Comments
 (0)