From 7297682cadae3e2c48f2a09d20a6191b561c1eeb Mon Sep 17 00:00:00 2001 From: Weijie Zhao Date: Mon, 2 Mar 2026 16:18:20 +0800 Subject: [PATCH] fix: remove invalidateAvatarCache call that broke request deduplication (#2317) When multiple avatar components mount with alternating sizes (e.g. 48 and 20), invalidateAvatarCache clears pending requests for ALL sizes of the same user, causing each call to create a new HTTP request instead of reusing the pending one. I noticed this issue when I open a task with 20 comments, the avatar requests make the service OOM. image Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- frontend/src/models/user.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/frontend/src/models/user.ts b/frontend/src/models/user.ts index d106d6a99..24d64665d 100644 --- a/frontend/src/models/user.ts +++ b/frontend/src/models/user.ts @@ -24,9 +24,7 @@ export async function fetchAvatarBlobUrl(user: IUser, size = 50) { if (pendingRequests.has(key)) { return await pendingRequests.get(key) as string } - - invalidateAvatarCache(user) - + // Create a new request const requestPromise = avatarService.getBlobUrl(`/avatar/${user.username}?size=${size}`) .then(url => {