Files
Dario Gabriel LipicarandClaude Opus 5 a46a05deae fix(qml-bridge): three defects in the call-path change, and the tests that were missing
A compatibility audit found three bugs in the previous commit. All three shipped
green, because that commit touched one source file and no test file — so the 7/7
it reported said nothing about any of them. Each fix below now has a test that
was shown to fail against the un-fixed tree and pass with it.

1. A TIMED-OUT CALL WAS STILL SENT. The whenObjectAvailable callback ran
   dispatch() unconditionally; the `fired` flag suppressed only the CALLBACK. So
   an install / send / transfer could execute minutes after the view had been
   told it timed out. Holding a call is only at-most-once if the hold is
   abandoned when the caller stops waiting — otherwise it is a delayed re-send
   with extra steps. The new test asserts on the PROVIDER's call count, not the
   callback, because "suppressed" and "never sent" are indistinguishable from
   the callback and only the second is the property claimed.

2. timeoutMs <= 0 COULD STRAND THE CALLER. Documented as "pass 0 to disable".
   With no deadline and an unbounded wait for the module, the callback never
   fired at all. Dispatching immediately instead — the first attempt — was worse:
   it reaches the synchronous acquire inside invokeRemoteMethodAsync and blocks
   the calling thread for the full default budget, which is the GUI-thread stall
   this whole area exists to remove, smuggled back in through the one path that
   opted out of deadlines. "No deadline on the call" now means exactly that: the
   WAIT still carries one, used only to guarantee a callback, never to cap the
   method. The test deliberately never publishes the module, because the earlier
   version of it published one and therefore passed against the broken code too.

3. THE STARTUP BUDGET CAPPED EXECUTION. One Timeout feeds both
   acquireCachedObject and callMethod, so Timeout(1500) capped every method, not
   just the acquire — a network fetch, a package install, a chain RPC all began
   failing at 1500 ms, and old QML shipped inside a .lgx cannot opt out because
   callModule takes no timeout argument. The short budget now applies only when
   the module is NOT reachable, which is the case it was written for; a reachable
   module keeps the budget it always had.

7/7 green, and 3/3 of the new cases red against the previous commit.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-10 14:07:18 -03:00
..