The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.
TypeScript clickhousemysqlnextjsopen-sourceplanetscaleprismatailwindcsstinybirdtypescriptupstashvercel
Update track-lead.ts
Steven Tey2942e67c9dc6
diff --git a/apps/web/lib/api/conversions/track-lead.ts b/apps/web/lib/api/conversions/track-lead.tsindex 04c3d0ba5f..109b1e2327 100644--- a/apps/web/lib/api/conversions/track-lead.ts+++ b/apps/web/lib/api/conversions/track-lead.ts@@ -78,7 +78,7 @@ export const trackLead = async ({// if not deferred mode, we need to deduplicate lead events – only record 1 unique event for the same customer and event name// TODO: Maybe we can replace this to rely only on MySQL directly since we're checking the customer above?if (mode !== "deferred") {- const ok = await redis.set(+ const res = await redis.set(`trackLead:${workspace.id}:${customerExternalId}:${stringifiedEventName}`,{timestamp: Date.now(),@@ -94,7 +94,8 @@ export const trackLead = async ({nx: true,},);- deduplicate = ok ? true : false;+ // if res = null it means the key was already set+ deduplicate = res === null ? true : false;}// if this event doesn't need to be deduplicated