Promise vere e await: la coda dei microtask viene svuotata
Il difetto: Boa le Promise le ha, ma nessuno chiamava run_jobs(), quindi ogni .then restava in coda per sempre e la pagina non si aggiornava — senza un solo errore da leggere. - fetch restituisce una Promise costruita dal motore (new Promise + resolve/reject tenuti nella richiesta), non più un oggetto con un then finto - text() e json() restituiscono Promise anche loro, come nel browser: senza, "await r.text()" riceveva la stringa e chi si aspettava una Promise si rompeva - run_jobs() dopo ogni ingresso di JavaScript: script, eventi, timer, consegna delle risposte di fetch - il guscio desktop serve le fetch anche nel percorso senza finestra: con --aspetta l'attesa non serviva a niente e la pagina restava sulla scritta iniziale - 7 test nuovi (tests/promise.rs): then, await, fetch+text, fetch+json, catch, Promise.all, Promise accesa dentro un gestore di clic - aggiornato il test che si aspettava r.text() sincrona: codificava la vecchia semplificazione, non il comportamento giusto Verifica end-to-end su HTTP vero: una pagina con await fetch e await r.json() mostra "ricevuto: Mosaic (200)". Wikipedia, che usa async/await ovunque, si carica senza panic.
This commit is contained in:
1 parent
71f45d8967
commit
6a14853d0d
6 files changed
+241
-18
No files matched your search
@@ -1,6 +1,6 @@
|
||||
Name: harbour-mosaic
|
||||
Summary: Mosaic browser with an independent rendering engine
|
||||
Version: 0.8.10
|
||||
Version: 0.8.11
|
||||
Release: 1
|
||||
Group: Qt/Qt
|
||||
License: MIT
|
||||
@@ -21,6 +21,11 @@ engine written from scratch (no WebKit, Blink, Gecko or Servo code).
|
||||
Milestone M0: HTML parsing, CSS cascade, block layout and CPU raster.
|
||||
|
||||
%changelog
|
||||
* Thu Nov 12 2026 Carlo Baratto <carlo@carlobaratto.it> - 0.8.11-1
|
||||
- Promise vere e await: fetch restituisce una Promise del motore, text()/json()
|
||||
anche, e i microtask vengono svuotati dopo script, eventi, timer e consegna
|
||||
delle risposte. Prima ogni .then restava in coda per sempre, senza errori
|
||||
|
||||
* Thu Nov 12 2026 Carlo Baratto <carlo@carlobaratto.it> - 0.8.10-1
|
||||
- Rete: HTTP/2 con HPACK (tabelle generate dalla RFC 7541), negoziato via ALPN
|
||||
- Proxy http_proxy/https_proxy/no_proxy con tunnel CONNECT
|
||||
|
||||
Reference in new issue
Block a user