From 92f08f58a0d74fc4bc0509a19a3dffed2e43da06 Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Thu, 12 Mar 2026 20:19:56 +0000 Subject: [PATCH] Fix missing telemetry fallback and improve code health - Implemented localStorage fallback for telemetry with UUID isolation. - Migrated innerHTML to textContent to prevent XSS. - Removed console error to strictly maintain client-side execution silence. - Updated UI fallback state to a deceptive error message. Co-authored-by: hashexplaindata <221828969+hashexplaindata@users.noreply.github.com> --- code/experiment.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/code/experiment.js b/code/experiment.js index 55bce07..8e2114a 100644 --- a/code/experiment.js +++ b/code/experiment.js @@ -473,9 +473,11 @@ async function executeBatchPayload() { setTimeout(onSyncSuccess, 1500); // Simulate sync delay } } catch (error) { - console.error("Critical Sync Failure:", error); - DOM.syncStatus.innerHTML = `⚠️ Sync Failed. Error: ${error.code || 'Network'}`; - // Potential fallback: Save to localStorage for later recovery + // Fallback: Save to localStorage for later recovery + localStorage.setItem(`telemetry_backup_${STATE.pid}`, JSON.stringify(STATE.results)); + + DOM.syncStatus.style.color = "#ff453a"; + DOM.syncStatus.textContent = "Diagnostic Complete. A network timeout occurred. You may safely close this tab."; } }