From 9e0feb57405e702325349bca095a0d7c58047f4c Mon Sep 17 00:00:00 2001 From: Raminder Singh Date: Wed, 13 May 2026 13:47:20 +0530 Subject: [PATCH] fix: search on the partners/integrations page was still using misc db (#45866) The `INTEGRATIONS_MARKETPLACE_DB` was not included in the client bundle (because it doesn't start with `NEXT_PUBLIC_`) which caused the client side search functions on the https://supabase.com/partners/integrations page to keep using the older misc db for search. Steps to reproduce: * Go to the https://supabase.com/partners/integrations page. * Search for `aikido`. * Click the only tile found for this search term. Notice that it takes you to `https://supabase.com/partners/integrations/aikido-security` which 404s. This is because that slug (`aikido-security`) is coming from the old misc db. The correct slug in the new db is `aikido`. Other fixes: * Corrected the tsv column name from `tsv` to `listing_tsv`. * Fixed search debouncing. --- apps/www/.env.local.example | 2 +- apps/www/lib/marketplaceDb.ts | 5 +++-- apps/www/pages/partners/integrations/index.tsx | 14 +++++--------- apps/www/turbo.jsonc | 2 +- 4 files changed, 10 insertions(+), 13 deletions(-) diff --git a/apps/www/.env.local.example b/apps/www/.env.local.example index 8e5de146b7e..517bb89bd7b 100644 --- a/apps/www/.env.local.example +++ b/apps/www/.env.local.example @@ -2,7 +2,7 @@ CMS_API_KEY=secret CMS_PREVIEW_SECRET=secret HCAPTCHA_SECRET_KEY=0x0000000000000000000000000000000000000000 -INTEGRATIONS_MARKETPLACE_DB=true +NEXT_PUBLIC_INTEGRATIONS_MARKETPLACE_DB=true MISC_USE_SERVICE_ROLE_KEY=secret NEXT_PUBLIC_API_URL=http://localhost:8080/platform NEXT_PUBLIC_DESIGN_SYSTEM_URL=http://localhost:3003 diff --git a/apps/www/lib/marketplaceDb.ts b/apps/www/lib/marketplaceDb.ts index e93eb27b1b1..f38fc4ae5f7 100644 --- a/apps/www/lib/marketplaceDb.ts +++ b/apps/www/lib/marketplaceDb.ts @@ -6,7 +6,8 @@ import supabase from './supabaseMisc' // Switch between new Marketplace DB and legacy Supabase Misc DB by updating the environment var // in the Vercel deployment and redeploying, as that will take effect more quickly than flipping a // feature flag in ConfigCat and waiting for the revalidate timeout. -const isUseMarketplaceDb = process.env.INTEGRATIONS_MARKETPLACE_DB?.toLowerCase() === 'true' +const isUseMarketplaceDb = + process.env.NEXT_PUBLIC_INTEGRATIONS_MARKETPLACE_DB?.toLowerCase() === 'true' const marketplaceClient = createMarketplaceClient() @@ -103,7 +104,7 @@ async function searchMarketplaceListings(search: string): Promise { - const doSearch = async () => { - setIsSearching(true) - return await searchPartners(search) - } - - if (search.trim() === '') { + if (debouncedSearchTerm.trim() === '') { setIsSearching(false) setPartners(initialPartners) return } - doSearch().then((partners) => { + setIsSearching(true) + searchPartners(debouncedSearchTerm).then((partners) => { if (partners) { setPartners(partners) } setIsSearching(false) }) - }, [debouncedSearchTerm, router]) + }, [debouncedSearchTerm, initialPartners]) return ( <> diff --git a/apps/www/turbo.jsonc b/apps/www/turbo.jsonc index 71c0137e974..cc563b675cc 100644 --- a/apps/www/turbo.jsonc +++ b/apps/www/turbo.jsonc @@ -29,7 +29,7 @@ "VERCEL", "VERCEL_ENV", "VERCEL_GIT_COMMIT_SHA", - "INTEGRATIONS_MARKETPLACE_DB", + "NEXT_PUBLIC_INTEGRATIONS_MARKETPLACE_DB", "NEXT_PUBLIC_MARKETPLACE_API_URL", "NEXT_PUBLIC_MARKETPLACE_PUBLISHABLE_KEY", // These envs are used in the packages