diff --git a/web/modules/custom/figli_compta_ledger/js/home.js b/web/modules/custom/figli_compta_ledger/js/home.js index 9de192b..e27e3b3 100644 --- a/web/modules/custom/figli_compta_ledger/js/home.js +++ b/web/modules/custom/figli_compta_ledger/js/home.js @@ -1455,14 +1455,24 @@ // Every toolbar filter change routes through here: with filtering // now server-side (see fetchFilteredLignes()), there's no more // "just recompute a client-side view" -- the currently loaded - // window has to be re-fetched with the new filter applied. Queued - // through the same chain as loadOlder()/loadNewer() (see - // _queueWindowOp) since several filters can change in the same - // tick (e.g. mounted() restoring them all from the URL hash at - // once), and interleaving their fetches would race on `rows` the - // same way parallel loadOlder()/loadNewer() calls used to. + // window has to be re-fetched with the new filter applied. The + // reload itself is queued through the same chain as loadOlder()/ + // loadNewer() (see _queueWindowOp) since several filters can change + // in the same tick (e.g. mounted() restoring them all from the URL + // hash at once), and interleaving their fetches would race on + // `rows` the same way parallel loadOlder()/loadNewer() calls used + // to. ensureScrollable() is deliberately chained AFTER that queued + // op settles, not passed into it: ensureScrollable() itself calls + // loadOlder()/loadNewer(), which each enqueue their own op onto the + // very same chain -- queuing it *inside* the op currently occupying + // that chain made the chain await its own continuation (the queued + // op can't finish until its child call, appended behind it on the + // same chain, finishes first) and deadlocked solid the moment a + // filter actually left too few rows to fill the viewport, wedging + // every future filter change and scroll-triggered load right along + // with it. onFilterChanged() { - this._queueWindowOp(() => this.reloadWindow().then(() => this.ensureScrollable())); + this._queueWindowOp(() => this.reloadWindow()).then(() => this.ensureScrollable()); this.syncHash(); }, // Keeps extending the window (both directions) as long as a filter