From 795a9f4629aead2dc7a77f21835458040abcd591 Mon Sep 17 00:00:00 2001 From: alma Date: Mon, 28 Apr 2025 14:41:44 +0200 Subject: [PATCH] courrier multi account restore compose --- lib/services/email-service.ts | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/lib/services/email-service.ts b/lib/services/email-service.ts index 0f76b18a..03880aff 100644 --- a/lib/services/email-service.ts +++ b/lib/services/email-service.ts @@ -275,13 +275,9 @@ export async function getEmails( console.log(`Fetching emails for user ${userId}${accountId ? ` account ${accountId}` : ''} in folder ${folder}`); // Try to get from cache first - const cacheKey = accountId - ? `email:list:${userId}:${accountId}:${folder}:${page}:${perPage}:${searchQuery}` - : `email:list:${userId}:${folder}:${page}:${perPage}:${searchQuery}`; - const cached = await getCachedEmailList(userId, accountId || 'default', folder, page, perPage); if (cached) { - console.log(`Using cached email list for ${cacheKey}`); + console.log(`Using cached email list for ${userId}${accountId ? ` account ${accountId}` : ''} in folder ${folder}`); return cached; } @@ -356,7 +352,7 @@ export async function getEmails( mailboxes: await getMailboxes(client) }; - // Cache the result + // Cache the result with the correct accountId await cacheEmailList(userId, accountId || 'default', folder, page, perPage, result); return result;