Repository navigation
Open
Labels
Description
Describe the bug
Several places create blob URLs via URL.createObjectURL but never call URL.revokeObjectURL. The browser keeps the underlying blob in memory until the URL is revoked or the page is unloaded. Since Web is a long-lived SPA, memory grows over a session.
Steps to reproduce
- Download a few mail attachments or a password protected public link archive, upload files into a folder you're viewing via SSE, or browse through images in the preview app.
- Open
chrome://blob-internals(or the memory tab in dev tools).
Expected behavior
Blob URLs are revoked once they're no longer needed.
Actual behavior
Blob URLs (and their blobs) stay alive until the tab is closed.
Additional context
Never revoked
- Mail attachment download -
packages/web-app-mail/src/components/MailAttachmentItem.vue:119: object URL passed totriggerDownloadWithFilenameand never revoked. - Mail appointment download -
packages/web-app-mail/src/components/MailAppointmentItem.vue:167: same. - Archive download with public link password -
packages/web-pkg/src/services/archiver.ts:90: the whole archive is fetched into a blob and the URL is never revoked. The URL is also returned to the caller. - SSE processing finished -
packages/web-runtime/src/container/sse/files.ts:206(onSSEProcessingFinishedEvent): callspreviewService.loadPreviewwithoutcached = true, so the blob URL bypasses the preview cache (and itsonEvictrevoke) and is written to the resource'sthumbnail. Leaks one thumbnail per event, e.g. every upload by another client into the current folder. - Avatars -
packages/web-pkg/src/composables/piniaStores/avatars.ts:16,24:addAvataroverwrites andremoveAvatarnulls the entry without revoking the previous blob URL. Affects own avatar upload/removal inpackages/web-pkg/src/components/Avatars/AvatarUpload.vue:149.resethas the same issue.AvatarUpload.vue:161-176also leaks the new object URL when the upload fails (created at :161, dropped in the catch). Creating it only after the upload succeeded avoids that.avatarMapinpiniaStores/avatars.tshas no size limit, so user lists, sharees and space members keep one avatar blob per user ever displayed. An LRU limit (revoking on evict, e.g. viahelpers/cache/cache.ts) would bound it, but must not evict avatars that are still mounted, sinceUserAvatar.vueonly reloads when theuserIdchanges.
Revoked in some paths only
- AppWrapper -
packages/web-pkg/src/components/AppTemplates/AppWrapper.vue:500:url.valueis overwritten whenloadFileTaskruns again (file context change) without revoking the old URL. Only the last one is revoked on unmount. If the restartable task is cancelled aftergetUrlForResourceresolved, that URL is lost too. Affects apps usingdisposition: 'inline'(pdf-viewer, preview) and any vault file (useAppFileHandling.ts:62always returns a blob URL for vault resources). - Preview app
packages/web-app-preview/src/composables/useMediaFileLoader.ts:156: when the image warm-up fails,mediaFile.url = undefineddrops the URL without revoking it before retrying.packages/web-app-preview/src/App.vue:234(buildMediaFiles): rebuildsmediaFileswheneveractiveFileschanges (e.g. after deleting a file), dropping all loaded URLs without revoking them.onBeforeUnmountonly revokes the URLs of the current list.- Loads resolving after unmount (
isDisposed) still assign a URL that is never revoked. - Images are loaded uncached (
useMediaFileLoader.ts:123), so every visited image stays in memory until the app is closed. Browsing a large folder accumulates all previews. Not a leak strictly, but unbounded.
Fine
useDownloadFile (revoked after 30s), previewService cached path (cache.ts revokes on evict), useMotionPhoto, OcFileInput, web-app-office-settings, and the web-extensions apps (pastebin, bpmn).
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsPrio <= 3
Activity