From 9c68ceafeb8ac9990e0c0c64a47796395299d604 Mon Sep 17 00:00:00 2001 From: Paulo Victor Cordeiro <146781332+pvcordeiro@users.noreply.github.com> Date: Tue, 2 Jun 2026 17:55:59 +0100 Subject: [PATCH] fix: use cached blob URL in _createChip to prevent memory leak (#1266) _createChip called URL.createObjectURL directly, bypassing the _getPreviewUrl/_revokePreviewUrl cache. Each re-render of the attachment strip leaked blob URLs that were never revoked. --- static/js/fileHandler.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/static/js/fileHandler.js b/static/js/fileHandler.js index 9e5dbad..e62382d 100644 --- a/static/js/fileHandler.js +++ b/static/js/fileHandler.js @@ -112,7 +112,7 @@ function _createChip(f, idx) { chip.classList.add('thumb-image'); // lets CSS overlay the remove-X on the corner (mobile) const img = document.createElement('img'); img.className = 'thumb-img'; - img.src = URL.createObjectURL(f); + img.src = _getPreviewUrl(f); img.alt = f.name || 'image'; chip.appendChild(img); } else {