Response to "Using Flua to test and debug Fibaro QuickApps"

Reply to the experience report (pt_using_flua.md) and the change proposals (pt_using_flua_proposed_changes.md), 31 October 2026. Addressed in release 0.1.111.

Thank you for this report — it is the kind of feedback we can act on directly: reproductions instead of impressions, acceptance criteria per proposal, and a clear statement of what was not qualified (debugger, proxy, physical devices). We verified both P0 reproductions against the then-current release and confirmed them, then triaged the nine change proposals into three batches. This document records what shipped, what is scheduled, and where we made a different call than the proposal.

Verified reproductions

Both P0s reproduced on 0.1.110 exactly as described:

  1. Unhandled timer error → exit 0. The callback error and traceback print, but the process exits 0 — and a later _FLUA.exit(0) cannot clear it because no failure state exists. Confirmed.
  2. Instant-mode clock jump. With --instant --run-for -3, the 1 s timer observed os.time() - start == 2 because a 2 s timer was also queued. Root cause: instant mode swept the whole timer heap in one pass and advanced the clock to each deadline as it popped them — so by the time the pump delivered the first callback, the clock already read the last deadline. Confirmed.

What shipped in 0.1.111

Change 02 — instant-mode callbacks observe their own deadlines (P0) ✅

--instant now uses the same deadline-ordered discipline as --step: only the earliest timer fires per pump pass, and the clock advances to its deadline just before its callback runs. Both modes share one deadline_ordered clock property, so --instant and --step are now the same fast-forward semantics (under two names — --step keeps the plua spelling). --speed remains the continuous clock, with its documented "virtual time passes while your code executes" caveat.

Change 03 — QuickApp:removeChildDevice(id) (P1) ✅

Implemented on the real HC3 endpoint, DELETE /plugins/removeChildDevice/{id} (the simulated route already existed: 404 for unknown ids, 501 for non-children, 204 on success, with device-removed events). The method is guarded to the QA's own children — a foreign id returns nothing and the child stays in the inventory — and a successful removal clears the QA's local self.childDevices entry, so a repeated call returns nothing instead of re-deleting.

Change 08 (partial) — runtime diagnostics ✅

flua --version --machine now reports:

{"version": "0.1.111", "lua": "Lua 5.4", "lupa": "2.6",
 "python": "3.14.3", "integerBytes": 8, "locale": "C/C.UTF-8/C/C/C"}

Lua/Python/Lupa versions, native integer width, and locale — the fields you asked for. The clock mode is not in there yet (it is not meaningful for --version); it belongs to a per-run result record instead, which ties into Change 05 below.

Tooling follow-ups from your report

What is scheduled, per the agreed split

Batch B (next release) — the remaining P0 and its companion

Batch C (scheduled separately)

Points where we made a different call

Please re-run your suite

All of this is in fibaro-flua==0.1.111. Your two P0 fixtures should now behave as specified (the clock one is fixed; the exit-code one is the last item of Batch B and still reproduces — by design, until --strict-tests ships). The 30-check suite result and any new findings are welcome; the same triage process applies.

— flua maintainers


Follow-up from the feedback author

Received after 0.1.111:

Thanks for the fixes and the detailed response. We (me and Codex :) ) reran the suite on Flua 0.1.111, and all 32 tests passed. We verified the timer fixes, including nested timers in both --instant and --step, as well as child removal and registry/REST consistency. Once --strict-tests is released, we'll also test callback-error exit codes, including the case where a later callback calls _FLUA.exit(0).

Status: Batch A confirmed in the field. Batch B (--strict-tests + --result-json) is the remaining work, and the author has committed to testing the sticky-exit-code behavior when it ships.