Elffuss BraidHub

utopia-ia/elffuss-claw public

Telemetry: a report carries only the page address, as in Elffuss Code

telemetry.js is shared with Elffuss Code. Code's integration branch
(f4a384c) sends only origin + path: its file links put project file names in
the fragment. Claw's ux-fix (1f3ce9e) had already dropped the fragment, which
holds where you are (an app name, a task id, a path in your folder), but kept
the query, which can name one of your skills (?skill=…). Now both copies run
the same code; only the comments differ.
Changeset10af286d6007921d80dee1e7fc34024c8e5dcb4c719fc0aa6194dd322e9efbf4
AuthorKikoCis <kikocisneros@gmail.com> · 2026-10-11 18:05 +02:00
CommitterKikoCis <kikocisneros@gmail.com> · 2026-10-11 18:05 +02:00
Parents22e4b8f6672e

Browse the files at this changeset

1 file changed

modified web/js/telemetry.js +12 −8
@@ -23,25 +23,29 @@
2323 if (enabled) hookGlobalErrors();
2424 }
2525
26-// Devuelve si el informe LLEGÓ (true) o no (false). Antes no devolvía nada y
27-// quien mandaba feedback decía «¡enviado, gracias!» aunque el envío fallara.
26+// Devuelve si el servidor lo aceptó DE VERDAD (respuesta 2xx). Antes no
27+// devolvía nada y quien mandaba feedback decía «¡enviado, gracias!» aunque el
28+// servidor contestara 404 o no hubiera red.
2829 async function post(kind, message, opts = {}) {
2930 if (!enabled) return false;
3031 try {
31- const r = await fetch('/proxy/report', {
32+ const res = await fetch('/proxy/report', {
3233 method: 'POST',
3334 headers: { 'Content-Type': 'application/json' },
3435 body: JSON.stringify({
3536 app: appName, kind, message: String(message ?? '').slice(0, 2000),
3637 stack: String(opts.stack || '').slice(0, 4000),
37- // Sin el fragmento (#/…): la app guarda ahí dónde estás (rutas.js) —
38- // un nombre de app, un id de tarea, una ruta dentro de tu carpeta— y
39- // eso no tiene por qué viajar en un informe de error.
40- url: location.origin + location.pathname + location.search, userAgent: navigator.userAgent,
38+ // Solo la página, sin búsqueda ni fragmento. El fragmento (#/…) guarda
39+ // dónde estás (rutas.js): un nombre de app, un id de tarea, una ruta
40+ // dentro de tu carpeta; la búsqueda puede nombrar una skill tuya
41+ // (?skill=…). Nada de eso tiene por qué viajar en un informe de error.
42+ // (Igual que la copia de Elffuss Code, donde #/file/<ruta> metía
43+ // nombres de ficheros del proyecto en cada informe.)
44+ url: location.origin + location.pathname, userAgent: navigator.userAgent,
4145 extra: String(opts.extra || '').slice(0, 2000),
4246 }),
4347 });
44- return r.ok;
48+ return res.ok;
4549 } catch { return false; /* sin conexión o proxy caído: se descarta, no hay reintento */ }
4650 }
4751