|
Ran
|
Files
553
|
Run time
17s
|
Badge
README BADGES
|
push
github
fix(web): avoid bulk selection working with stale copies (#3289) By deriving the selection state instead of saving full copies. Quoting c25040a76 message: > Storing full device objects in the reducer selection meant that any external update to the devices prop (e.g. a status change triggered by a row action) left the selection holding stale snapshots. > > A UPDATE_DEVICE action existed to patch stale copies in-place, but it was broken and never called. Even if fixed, syncing props into reducer state via useEffect would be one render behind and is an anti-pattern React explicitly discourages: don't store what you can compute. Check https://react.dev/learn/you-might-not-need-an-effect#adjusting-some-state-when-a-prop-changes > > Selection state now tracks only channel IDs. The actual Device objects are derived on each render by filtering the current devices prop, ensuring bulk actions always operate on up-to-date data. UPDATE_DEVICE is removed as it is no longer needed. --- As an additional, kind of related change, the status values for status column has been translated in commit https://github.com/agama-project/agama/pull/3289/commits/5b7a7de4a
3245 of 5220 branches covered (62.16%)
Branch coverage included in aggregate %.
12662 of 16786 relevant lines covered (75.43%)
74.49 hits per line
| Coverage | ∆ | File | Lines | Relevant | Covered | Missed | Hits/Line | Branch Hits | Branch Misses |
|---|