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

zwave-js / zwave-js-ui / 27533209408
19%

Build:
DEFAULT BRANCH: master
Ran 15 Jun 2026 08:18AM UTC
Jobs 1
Files 71
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

15 Jun 2026 08:17AM UTC coverage: 19.652% (-0.006%) from 19.658%
27533209408

push

github

web-flow
fix(ui): keep node index map consistent after node removal (#4667)

## Problem

Closes #4666

After using **Advanced → Failed Node → Replace** to replace a node, the
node's **Status icon stays "Dead"** in the UI even though everything
else works — pinging the node reports success, but the icon won't update
until the browser is refreshed.

## Root cause

The frontend store (`src/stores/base.js`) maintains `nodesMap`, a
`nodeId → index in this.nodes` lookup used by both `getNode` and
`updateNode`. `removeNode` spliced a node out of the array but only
deleted *that* node's `nodesMap` entry:

```js
this.nodesMap.delete(n.id)
this.nodes.splice(index, 1)   // every later node shifts down one slot
```

Splicing shifts every node *after* the removed index down by one, but
their `nodesMap` entries keep pointing at the old (now off-by-one)
index. "Replace Failed Node" removes the old node mid-array and then
re-includes a new one, so afterwards the map is wrong for every later
node. Incoming **partial** `nodeUpdated` status events (alive/dead/ping)
are then `Object.assign`-ed into the *wrong* array slot, so the visible
node's status never changes.

A browser refresh fixes it because `init` → `initNodes` rebuilds the map
from scratch — which also confirms the backend status was correct the
whole time.

## Fix

Rebuild `nodesMap` from the array after the splice, matching the
reassign-a-fresh-`Map` pattern already used by `resetNodes`. This is the
removal-side counterpart to the existing `updateNode` decision (#4639)
to avoid splicing-on-update for the same index-integrity reason.

Frontend-only, one method changed.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

410 of 535 branches covered (76.64%)

Branch coverage included in aggregate %.

0 of 8 new or added lines in 1 file covered. (0.0%)

4419 of 24037 relevant lines covered (18.38%)

1.16 hits per line

Uncovered Changes

Lines Coverage ∆ File
8
0.0
0.0% src/stores/base.js
Jobs
ID Job ID Ran Files Coverage
1 27533209408.1 15 Jun 2026 08:18AM UTC 71
19.65
GitHub Action Run
Source Files on build 27533209408
  • Tree
  • List 71
  • Changed 1
  • Source Changed 0
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • 58ba24ee on github
  • Prev Build on master (#27340538910)
  • Next Build on master (#27677727548)
  • Delete
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc