Rapporto di diagnostica della raccolta (#39)
verifica / controlli (push) Successful in 18s
verifica / prove (push) Successful in 13m5s
verifica / installatore (push) Successful in 4m11s
verifica / immagine (push) Successful in 14m4s

Dopo una prova dal vivo andata male, Alberto deve poter mandare un solo file che
spieghi perché, senza che nessuno veda dati di altre persone. Attività ha ora il
pulsante «Diagnostica», che scarica il rapporto delle sessioni degli ultimi 14 giorni:
pagine aperte e forma degli indirizzi, risposte per tipo, stato e dimensione con ciò
che i lettori ne hanno fatto, struttura stretta delle forme sconosciute, ricette,
segnali, permessi negati, file in coda e scaricati, e il motivo di ogni arresto.

Nel rapporto entrano solo valori da elenchi chiusi, numeri, orari e forme: mai nomi,
indirizzi completi, codici, cursori, cookie o pezzi di risposte. Le forme degli
indirizzi e la regola delle chiavi-dato passano dalla sonda a Core, e la sonda le
richiama. Il registratore non lancia mai eccezioni verso la raccolta e tiene i file in
Dati/diagnostica per 14 giorni.

Prova che il rapporto non contiene valori, con controlli di mutazione; tre giri di
revisione avversaria (25 difetti confermati, tutti corretti).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Alby96andClaude Opus 5.5 committed 2026-11-13 14:41:34 +01:00
1 parent bf03cb45a5
commit badd1681a0
55 files changed
+5395 -134

No files matched your search

+5 -2
View File
@@ -104,9 +104,12 @@ export function eventsUrl() {
return withCarried('/api/eventi');
}
/** Downloads an answer as a file (CSV export). */
/**
* Downloads an answer as a file: a POST with the body (CSV export), or a GET when the body is null (diagnostic report).
* Through api(), so the carried scene and shell travel with it.
*/
export async function download(path, body, fallbackName) {
const response = await api(path, { method: 'POST', body, raw: true });
const response = await api(path, body === null ? { raw: true } : { method: 'POST', body, raw: true });
const blob = await response.blob();
const disposition = response.headers.get('Content-Disposition') || '';
const match = /filename="?([^";]+)"?/.exec(disposition);
+34 -2
View File
@@ -4,7 +4,7 @@
// ones that are not stops, like a backfill completed or a disk almost full). It updates by itself from the event
// stream (the demo asks every 30 seconds). The red strip of a stop is drawn by the page frame.
import { api, withCarried } from '../core/api.js';
import { api, download, withCarried } from '../core/api.js';
import { h, icon, fill } from '../core/dom.js';
import { dotOf, refreshEngine } from '../core/engine.js';
import { openBrowser } from '../core/shell.js';
@@ -97,7 +97,39 @@ function drawActions(page, state) {
: h('button.btn', {
type: 'button', onclick: pause, disabled: ['Off', 'NotConnected'].includes(s.mode), 'aria-label': t('attivita.pausa'),
}, icon('pause'), h('span.testo-btn', t('attivita.pausa')));
page.actions(first, h('button.btn', { type: 'button', onclick: openBrowser, 'aria-label': t('attivita.apriBrowser') }, icon('app-window'), h('span.testo-btn', t('attivita.apriBrowser'))));
page.actions(
first,
h('button.btn', { type: 'button', onclick: openBrowser, 'aria-label': t('attivita.apriBrowser') }, icon('app-window'), h('span.testo-btn', t('attivita.apriBrowser'))),
diagnosticsButton(),
);
}
// True while a report is being exported. The title row is rebuilt at every engine update, so the button of the click
// may be gone by the end: the flag, not the button, says whether an export is running.
let exporting = false;
/** «Diagnostica»: the report of the last two weeks of sessions, with no name in it, to send after a test gone wrong (#39). */
function diagnosticsButton() {
const button = h('button.btn', {
type: 'button', title: t('attivita.esportaDiagnostica'), 'aria-label': t('attivita.esportaDiagnostica'), disabled: exporting,
}, icon('file-down'), h('span.testo-btn', t('attivita.diagnostica')));
button.onclick = async () => {
if (exporting) return;
exporting = true;
button.disabled = true;
try {
await download('/api/engine/diagnostica', null, 'febe-diagnostica.json');
toast(t('attivita.diagnosticaEsportata'));
} catch (error) {
showError(error);
} finally {
exporting = false;
// The button on the page now, which may not be this one.
for (const shown of document.querySelectorAll('[data-diagnostica]')) shown.disabled = false;
}
};
button.dataset.diagnostica = '';
return button;
}
// ------------------------------------------------------------------------------------------------- now
+3
View File
@@ -496,6 +496,9 @@
"pausa": "Metti in pausa",
"riprendi": "Riprendi",
"apriBrowser": "Apri il browser",
"diagnostica": "Diagnostica",
"esportaDiagnostica": "Esporta il rapporto di diagnostica",
"diagnosticaEsportata": "Rapporto di diagnostica esportato: il file è nei download del browser. Contiene solo conteggi, tempi e forme degli indirizzi, nessun nome né contenuto: puoi mandarlo così com'è.",
"anteprima": "Anteprima del browser di Febe",
"anteprimaOra": "Immagine delle {ora}",
"anteprimaVuota": "Il browser è sulla pagina vuota fino alla prossima sessione",