The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.
TypeScript clickhousemysqlnextjsopen-sourceplanetscaleprismatailwindcsstinybirdtypescriptupstashvercel
Update get-random-key.ts
Kiran K80a42ca93cff
diff --git a/apps/web/lib/planetscale/get-random-key.ts b/apps/web/lib/planetscale/get-random-key.tsindex a7e6434443..06e27fae45 100644--- a/apps/web/lib/planetscale/get-random-key.ts+++ b/apps/web/lib/planetscale/get-random-key.ts@@ -16,7 +16,9 @@ export async function getRandomKey({if (prefix) {key = `${prefix.replace(/^\/|\/$/g, "")}/${key}`;}+const exists = await checkIfKeyExists({ domain, key });+if (exists) {// by the off chance that key already existsreturn getRandomKey({ domain, prefix, long });