mirror of
https://github.com/go-vikunja/vikunja.git
synced 2026-03-09 07:13:35 -05:00
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. <img width="733" height="551" alt="image" src="https://github.com/user-attachments/assets/db45db31-294c-4363-ad27-38d454b5a6a2" /> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -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 => {
|
||||
|
||||
Reference in New Issue
Block a user