Commit 592631f
committed
fix(loading-spinner): stuck spinner after rapid concurrent requests
The loading interceptor toggles DfLoadingSpinnerService.active per request.
The service maintains a counter but decided whether to schedule a
BehaviorSubject emit by comparing shouldBeActive against active$.value —
stale during rapid toggles because emits are deferred with setTimeout.
Reproduction: event-script create form fires three concurrent GETs (services
list + two source control+file lookups). All complete inside one tick; the
final decrement is evaluated while pending setTimeouts haven't fired, so the
'active$.value (false) !== shouldBeActive (false)' check is FALSE and the
deactivate is skipped. The earlier queued next(true) then fires and the
spinner is stuck on forever until navigation.
Fix: decide transitions from the counter directly (wasActive vs isActive)
and use queueMicrotask. queueMicrotask still runs after the current change-
detection pass (so no ExpressionChangedAfterItHasBeenCheckedError) but
before the next macrotask, which keeps emit ordering consistent.
Also rebuilds dist/ so composer consumers pick up the fix.1 parent 7d5461c commit 592631f
4 files changed
Lines changed: 17 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
| 13 | + | |
14 | 14 | | |
This file was deleted.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
16 | 21 | | |
17 | 22 | | |
18 | 23 | | |
19 | 24 | | |
20 | 25 | | |
| 26 | + | |
21 | 27 | | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
31 | 37 | | |
32 | 38 | | |
33 | 39 | | |
0 commit comments