• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

zwave-js / zwave-js-ui / 32818987033
16%

Build:
DEFAULT BRANCH: master
Ran 25 Aug 2026 06:54AM UTC
Jobs 1
Files 50
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

25 Aug 2026 06:53AM UTC coverage: 13.158% (+0.4%) from 12.766%
32818987033

push

github

web-flow
fix(api): coalesce throttled calls when `fn` outlasts its wait window (#4779)

## Problem

`ZwaveClient.throttle` stamped `lastUpdate: Date.now()` before calling
`fn()`. A function slower than its own `wait` window therefore never
coalesced. The next call always saw `entry.lastUpdate + wait < now`, and
ran the leading edge again.

This hit `_updateBroadcastNodeValues` at `wait = 1000`. Its
`_doUpdateBroadcastNodeValues` calls
`broadcastInstance.getDefinedValueIDs()`. That walk visits
`getDefinedValueIDs()` and `getValueMetadata()` on every physical node
in the network. The rebuild then emits `valueChanged` for each resulting
value.

On a ~340-node network that walk takes seconds. Startup therefore ran a
full rebuild for every node that became ready. One trailing rebuild
would have covered them all.

Evidence: the driver log in zwave-js#9024 shows a uniform ~2.4–2.9 s gap
between consecutive per-node `Retrieving priority route to node X...`
lines. The gap holds for the entire 6-minute startup. No serial traffic
happens in between.

### Before — every call runs the leading edge

```mermaid
sequenceDiagram
    autonumber
    participant N as node ready event
    participant T as throttle, wait=1000
    participant F as _doUpdateBroadcastNodeValues

    Note over T: lastUpdate is stamped before fn runs

    N->>T: call at t=0
    T->>T: lastUpdate = 0
    T->>F: fn
    Note over F: walks all 340 nodes,<br/>blocks the event loop until t=2500
    F-->>T: returns at t=2500

    N->>T: call at t=2500
    Note over T: 0 + 1000 already elapsed<br/>leading edge again
    T->>T: lastUpdate = 2500
    T->>F: fn
    F-->>T: returns at t=5000

    N->>T: call at t=5000
    Note over T: 2500 + 1000 already elapsed<br/>leading edge again
    T->>F: fn
    Note over N,F: one full rebuild per node ready,<br/>nothing ever coalesces
```

### After — the window starts when `fn` returns

```mermaid
sequenceDiagram
    autonumber
    participant N as node ready event
    par... (continued)

535 of 4550 branches covered (11.76%)

Branch coverage included in aggregate %.

24 of 25 new or added lines in 1 file covered. (96.0%)

988 of 7025 relevant lines covered (14.06%)

2.17 hits per line

Uncovered Changes

Lines Coverage ∆ File
1
1.37
1.09% api/lib/ZwaveClient.ts
Jobs
ID Job ID Ran Files Coverage
1 32818987033.1 25 Aug 2026 06:54AM UTC 50
13.16
GitHub Action Run
Source Files on build 32818987033
  • Tree
  • List 50
  • Changed 1
  • Source Changed 0
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • a753819e on github
  • Prev Build on master (#32744714819)
  • Next Build on master (#33487673512)
  • Delete
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc