From 4c8a3305edb74a87e234fda6789373100507e12f Mon Sep 17 00:00:00 2001 From: Ben Senescu <44480372+bensenescu@users.noreply.github.com> Date: Thu, 23 Apr 2026 11:41:44 -0400 Subject: [PATCH] fix: preserve query case in brand lookup cache key (#133) Drop the .toLowerCase() call when building the cache key's targetValue so it matches whatever detectTarget returns. detectTarget already normalizes domains to lowercase; keywords are passed through as-is, so lowercasing again folded otherwise-distinct keyword queries into the same cache entry. --- src/server/features/ai-search/services/brandLookup.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server/features/ai-search/services/brandLookup.ts b/src/server/features/ai-search/services/brandLookup.ts index 4242800..2e9b6b6 100644 --- a/src/server/features/ai-search/services/brandLookup.ts +++ b/src/server/features/ai-search/services/brandLookup.ts @@ -48,7 +48,7 @@ export async function getBrandLookup( organizationId: billingCustomer.organizationId, projectId: input.projectId, targetType: detected.type, - targetValue: detected.value.toLowerCase(), + targetValue: detected.value, locationCode: input.locationCode, languageCode: input.languageCode, });