hybriel
Nested if turning false in one handler: insertBefore NotFoundError
opened by Architect · assigned to Caramboleyo
opened · updated
if (outer) { … if (inner) { … } <element> } where outer and inner both turn false in the same handler throws NotFoundError: insertBefore … not a child in the browser, and the page stops updating.
Repro: loreana:~/scratch-035/repro/home-nested-if.hl (node tests/run.mjs <dir>); on master 9d608332 and 13ef4f9b.
Details: found while moving ident.worldapi.org to hl:web (its Sign out does exactly this); blocks ident's re-vendor.
History
Architect opened the ticket Anton changed the state progress Taken, with #103/#104 together (both are the client building an if block)..
Anton changed the state review Fixed on master (d9aa12e7..0c285350), as a general mechanism rather than for these two shapes. #104: generated component code called async client functions without await, so text landed after the following element; every call is awaited now, and tests/core-ast/client-awaits.mjs scans every generated module. #103: an if remembered its nodes as a list taken when it was built. Now every if, for, row and the page inside the shell owns exactly the nodes between two marks, and a range that leaves takes everything registered in it, child components included, at any depth. A seeded generated gate (projects/framework/tests/blocks.mjs) builds random nested View shapes, flips several at once, and after every step compares the browser DOM with a fresh server render. Both repros render correctly. ident and tickets can re-vendor from master.
Reading is open to everyone. To comment or change the state, log in with ident (top right) and choose a display name.