Prove dell'interfaccia: WaitForQuietAsync dice che cosa aspetta davvero

Il commento di WaitForQuietAsync e la riga del 21/10 in decisioni.md
promettevano che, a pagina quieta, tutto ciò che la pagina ha fatto con
le risposte fosse finito. Vale solo per il seguito di ogni risposta, con
le richieste che parte lì: non per quelle che la pagina rimanda a un
osservatore, a un fotogramma, a un timer, al flusso degli eventi o a un
modulo che si carica dopo. Sulla Libreria con 40 elementi, al primo
momento senza richieste in volo le 11 righe del mosaico, chieste da un
IntersectionObserver dopo il disegno dei giorni, non erano ancora
partite in 3 giri su 6 (rilievo R1 della revisione).

Le cinque prove che la usano restano corrette: il comando sbagliato che
cercano partirebbe lasciando la pagina o nel seguito di una risposta.
Il testo ora dice questo, e che per una richiesta partita più tardi si
aspetta quella richiesta. Il codice non cambia: una quiete «stabile»
(qualche fotogramma in più) sarebbe di nuovo una finestra di tempo.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Alby96andClaude Opus 5.5 committed 2026-10-21 12:33:15 +02:00
1 parent 7513f41d4d
commit fe4ef9f048
2 files changed
+8 -4

No files matched your search

+7 -3
View File
@@ -312,9 +312,13 @@ internal sealed class UiBrowser : IAsyncDisposable
SendAsync("Page.addScriptToEvaluateOnNewDocument", new JsonObject { ["source"] = source });
/// <summary>
/// Waits until no request of the page is in flight (<see cref="Requests"/>): every command it sent has reached the
/// server and been answered, and whatever the page did with the answers, a new request included, has been done. The
/// moment to check that something did not happen, instead of a pause a slow machine may not wait out.
/// Waits until no request of the page is in flight (<see cref="Requests"/>): every request it started has reached
/// the server and been answered, and the page's continuation of each answer has run, a request it started there
/// included (that one starts before the answer it follows is over). What the page leaves for later is not waited
/// for: a request started by an observer, an animation frame, a timer, a message of the event stream or a module
/// still loading may come after (the mosaic asks for its rows from an observer, once it has drawn its days). The
/// moment to check that a command the page would send as it is left, or in the continuation of an answer, was not
/// sent, instead of a pause a slow machine may not wait out; for one started later, wait for that request itself.
/// </summary>
public Task WaitForQuietAsync(string what) => WaitAsync("window.__busy() === 0", what);