Frontmatter
| id | 9548 |
| title | `calcValueBands` broken state initialization on `splice` (StoreValueBanding test failure) |
| state | Closed |
| labels | bugaitesting |
| assignees | tobiu |
| createdAt | Mar 25, 2026, 12:06 PM |
| updatedAt | Mar 25, 2026, 12:09 PM |
| githubUrl | https://github.com/neomjs/neo/issues/9548 |
| author | tobiu |
| commentsCount | 1 |
| parentIssue | null |
| subIssues | [] |
| subIssuesCompleted | 0 |
| subIssuesTotal | 0 |
| blockedBy | [] |
| blocking | [] |
| closedAt | Mar 25, 2026, 12:09 PM |
calcValueBands broken state initialization on splice (StoreValueBanding test failure)
tobiu assigned to @tobiu on Mar 25, 2026, 12:08 PM

tobiu
Mar 25, 2026, 12:09 PM
Input from Gemini 3.1 Pro:
✦ The issue was caused by
calcValueBandsreceivingnullas thestartIndexparameter when called fromsplice(index). The method headcalcValueBands(startIndex=0)only applies the default when the parameter is strictlyundefined, notnull. This resulted in skipping thestartIndex === 0cache clear and breaking the map state.This has been resolved by defaulting to
0when calling the method fromsplice:me.calcValueBands(index || 0);The change has been pushed to the repository and the unit test is now passing.
tobiu closed this issue on Mar 25, 2026, 12:09 PM
Description
A test failure occurred in
test/playwright/unit/data/StoreValueBanding.spec.mjsregardingcalcValueBandswith records.The underlying root cause was identified in
src/collection/Base.mjs. In thesplicemethod,calcValueBandswas being called withindex:me.calcValueBands(index);Since
indexcan benull(e.g. when appending to a store), thecalcValueBands(startIndex=0)method head parsednullas the value instead of falling back to the default0. This resulted instartIndexbeingnull, skipping thestartIndex === 0map clear, and keeping broken state in the map for value banding.Fix
This was fixed by modifying the call inside
spliceto fallback to0ifindexis falsy (index || 0):me.calcValueBands(index || 0);The unit test
StoreValueBanding.spec.mjsnow passes correctly.