From f007d07bee53e21252fe5b72f69b2fb4d158cdfe Mon Sep 17 00:00:00 2001 From: Bohdan Triapitsyn Date: Sun, 23 Aug 2026 23:40:40 +0300 Subject: [PATCH] fix(desktop): serve packaged index.html with no-store The openchamber-ui:// handler returned index.html without cache headers, so the renderer disk cache could keep a freshly installed build loading the previous version's hashed bundles. Hashed assets stay cacheable; only the document that names them must not be. --- packages/electron/main.mjs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/packages/electron/main.mjs b/packages/electron/main.mjs index 9ecbead7..0442f814 100644 --- a/packages/electron/main.mjs +++ b/packages/electron/main.mjs @@ -1240,7 +1240,15 @@ const registerPackagedUiProtocol = () => { if (filePath.endsWith('.html')) { const html = await fsp.readFile(filePath, 'utf8'); const body = injectRuntimeConfigIntoHtml(html); - return new Response(body, { headers: { 'Content-Type': 'text/html; charset=utf-8' } }); + // index.html must never be cached: it names the hashed asset + // bundles, and a cached copy keeps a freshly installed build + // loading the previous version's UI from the renderer disk cache. + return new Response(body, { + headers: { + 'Content-Type': 'text/html; charset=utf-8', + 'Cache-Control': 'no-store', + }, + }); } return electronNet.fetch(pathToFileURL(filePath).toString()); }