Correzioni della revisione della catena 0.3.0, ognuna con la sua prova
- Collegamento: corretta la SyntaxError di connection.js (una «let saved» dichiarata due
volte nello stesso blocco fermava tutta la pagina). Nuova prova ScriptSyntaxTests con un
controllo scritto in casa che legge ogni modulo di wwwroot: parentesi, dichiarazioni
doppie nello stesso blocco, importazioni che il modulo di arrivo non esporta.
- HEIF: il riconoscimento dei formati prende ogni marchio che HeifDecoder accetta (mif2,
MiHE, marchi solo compatibili), così rilevazione, decodifica, misure, miniatura e
impronta concordano.
- Docker, lasciare la pagina del browser: un nuovo contratto del browser cancella l'uscita
annotata (_leftAt) anche prima che la vista si riapra, e la copia della sessione aspetta
un altro comando del collegamento al più LetGoWait invece che senza limite.
- JPEG e PNG: senza EOI o IEND la decodifica fallisce («File danneggiato o incompleto»),
la sola lettura delle misure resta tollerante.
- Visualizzatore: IsDamaged legge prima l'intestazione e il file intero solo quando può
servire, in modo asincrono e con una piccola memoria per file, così una scheda con
molti file non blocca il server.
- Importazione (§9.3): le immagini danneggiate si importano come le altre ma si segnano
nella revisione, nel resoconto e nel CSV.
- Pulizia: le prove con il limite di 5 minuti non corrono più in parallelo fra loro.
- Pila dei caratteri come l'appendice B, senza Liberation; testo di Informazioni sulle
immagini fatte in casa; guida (Problemi comuni, Sicurezza) allineata all'uscita in
Docker dalla pagina del browser.
- docs/decisioni.md: le righe del 25 novembre 2026 con i motivi, compresa l'unione 537517b
tenuta così com'è.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
3d234f8791
commit
2068dd28f3
35 files changed
+1366
-75
No files matched your search
@@ -369,6 +369,104 @@ public sealed class SessionCopyOnLetGoTests
|
||||
Assert.IsNull(bed.App.SavedSession!.Read());
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
[Timeout(60_000, CooperativeCancellation = true)]
|
||||
public async Task ABeginOfAReloadedPageCancelsTheLeaveEvenBeforeItsViewOpens()
|
||||
{
|
||||
var ct = TestContext.CancellationToken;
|
||||
await using var bed = await StartAsync();
|
||||
var browser = bed.Browser!;
|
||||
var connection = bed.App.Connection!;
|
||||
connection.PageLeaveGrace = TimeSpan.FromSeconds(1);
|
||||
var view = await DockerBeginAsync(bed);
|
||||
browser.FakeCdp.LoggedIn = true;
|
||||
browser.FakeCdp.Navigated(Site + "/");
|
||||
|
||||
// A reload where the new page's «begin» arrives but its view does not open within the moment: «begin» alone says
|
||||
// Alberto is back. Waited past PageLeaveGrace and well below DrivingGrace.
|
||||
await connection.LeavePageAsync(ct);
|
||||
view.Dispose();
|
||||
connection.RemoteViewClosed();
|
||||
await BeginAsync(bed, openLogin: false);
|
||||
await browser.HideFromUserAsync(ct);
|
||||
await Task.Delay(TimeSpan.FromSeconds(2.5), ct);
|
||||
Assert.IsTrue(browser.UserIsDriving, "begin cancels the leave");
|
||||
Assert.AreEqual(0, browser.FakeCdp.CaptureReads);
|
||||
Assert.DoesNotContain("Pagina del browser lasciata: nessuna vista", ReadLog(bed));
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
[Timeout(60_000, CooperativeCancellation = true)]
|
||||
[DataRow(false, DisplayName = "«pageLeft» tardivo della pagina ricaricata")]
|
||||
[DataRow(true, DisplayName = "vecchia vista chiusa da «Riprova»")]
|
||||
public async Task ALeaveFollowedByAViewOpenAgainIsForgottenWhenThatViewEndsFromTheServer(bool oldViewClosed)
|
||||
{
|
||||
var ct = TestContext.CancellationToken;
|
||||
await using var bed = await StartAsync();
|
||||
var browser = bed.Browser!;
|
||||
var connection = bed.App.Connection!;
|
||||
connection.PageLeaveGrace = TimeSpan.FromSeconds(1);
|
||||
var view = await DockerBeginAsync(bed);
|
||||
browser.FakeCdp.LoggedIn = true;
|
||||
browser.FakeCdp.Navigated(Site + "/");
|
||||
|
||||
// The leave arrives while a view is open: the keepalive «pageLeft» of a reloaded page after the new page's
|
||||
// «begin», or the old socket closed by «Riprova» while the new view opens without «begin».
|
||||
if (oldViewClosed)
|
||||
{
|
||||
connection.RemoteViewClosed();
|
||||
}
|
||||
else
|
||||
{
|
||||
await connection.LeavePageAsync(ct);
|
||||
}
|
||||
|
||||
await Task.Delay(TimeSpan.FromMilliseconds(600), ct);
|
||||
|
||||
// That view then ends from the server (the browser stopped): it is not told to the connection. A browser that is
|
||||
// down is not leaving it, so the lease waits for DrivingGrace, not for PageLeaveGrace.
|
||||
view.Dispose();
|
||||
await Task.Delay(TimeSpan.FromSeconds(2.5), ct);
|
||||
Assert.IsTrue(browser.UserIsDriving, "the earlier leave was forgotten once a view was open again");
|
||||
Assert.AreEqual(0, browser.FakeCdp.CaptureReads);
|
||||
Assert.DoesNotContain("Pagina del browser lasciata: nessuna vista", ReadLog(bed));
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
[Timeout(60_000, CooperativeCancellation = true)]
|
||||
public async Task LeavingTheBrowserPageWaitsForAnotherCommandOnlyForLetGoWait()
|
||||
{
|
||||
var ct = TestContext.CancellationToken;
|
||||
await using var bed = await StartAsync();
|
||||
var browser = bed.Browser!;
|
||||
var connection = bed.App.Connection!;
|
||||
connection.PageLeaveGrace = TimeSpan.FromMilliseconds(300);
|
||||
connection.LetGoWait = TimeSpan.FromMilliseconds(500);
|
||||
connection.PageTurnWait = TimeSpan.FromSeconds(30);
|
||||
var view = await DockerBeginAsync(bed);
|
||||
browser.FakeCdp.LoggedIn = true;
|
||||
browser.FakeCdp.Navigated(Site + "/");
|
||||
|
||||
// «Pagina iniziale» holds the commands of the connection while it waits for the page's turn, which a step of the
|
||||
// profile search keeps for longer than leaving the page may wait.
|
||||
using var press = CancellationTokenSource.CreateLinkedTokenSource(ct);
|
||||
Task startPage;
|
||||
using (await bed.App.Engine!.Services.PageTurns.TakeAsync(Febe.Core.Engine.PageUser.Search, ct))
|
||||
{
|
||||
startPage = connection.OpenStartPageAsync(press.Token);
|
||||
await Task.Delay(TimeSpan.FromMilliseconds(200), ct);
|
||||
view.Dispose();
|
||||
connection.RemoteViewClosed();
|
||||
await DesktopTestBed.WaitUntilAsync(() => !browser.UserIsDriving, TimeSpan.FromSeconds(10), "la fine della guida dopo l'attesa massima");
|
||||
press.Cancel();
|
||||
}
|
||||
|
||||
await startPage;
|
||||
Assert.AreEqual(0, browser.FakeCdp.CaptureReads);
|
||||
StringAssert.Contains(ReadLog(bed), "Pagina del browser lasciata: sessione non copiata, un altro comando del collegamento era ancora in corso.");
|
||||
Assert.IsNull(bed.App.SavedSession!.Read());
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
[Timeout(60_000, CooperativeCancellation = true)]
|
||||
public async Task LeavingTheBrowserPageOnTheLoginPageCopiesNothingButGivesThePageBack()
|
||||
|
||||
Reference in new issue
Block a user