fix: harden telemetry parsing and null node fallbacks

This commit is contained in:
SaelixCode
2026-03-18 20:31:57 -04:00
parent 7f23c88c73
commit f1f8e34da5
5 changed files with 53 additions and 2 deletions
+13
View File
@@ -24,6 +24,19 @@ export async function apiFetch(
throw new Error('Unauthorized');
}
// Intercept 404 Node Not Found responses and force context refresh
if (response.status === 404) {
try {
const clone = response.clone();
const errData = await clone.json();
if (errData.error && errData.error.includes('not found') && errData.error.includes('Node')) {
window.dispatchEvent(new Event('node-not-found'));
}
} catch (e) {
// Ignore JSON parse errors, caller handles standard 404s
}
}
return response;
}