Skip to content

engine: rebuild cell-store bands and counts when importing a JSON workbook - #1381

Merged
aiongg merged 1 commit into
storytold:mainfrom
midasmatterhorn:fix/issue-1008-json-cellstore-invariants
Oct 22, 2026
Merged

aiongg merged 1 commit into
storytold:mainfrom
midasmatterhorn:fix/issue-1008-json-cellstore-invariants

Conversation

@midasmatterhorn

Copy link
Copy Markdown
Contributor

The JSON reader deserialized the cell store's private bands and cached length as anything the file said, so a cell placed under a band its row doesn't map to vanished from lookup while iteration still saw it, and a forged count underflowed (len -= 1) on the next removal. JSON import now rebuilds band placement and the count from the cells themselves and drops coordinates outside the 1,048,576 × 16,384 grid with the same kind of warning the xlsx importer gives. A regression test forges a wrong band and a zero count, adds an off-grid cell, and checks lookup, the count, the warning and removal consistency. The full engine and model suites pass.

Fixes #1008

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(model): JSON import trusts serialized CellStore bands and cached length

2 participants