Frontmatter
| id | 5529 |
| title | vdom.Helper: createDeltas() => support for infinite scrolling is broken |
| state | Closed |
| labels | bug |
| assignees | tobiu |
| createdAt | Jul 4, 2024, 10:51 PM |
| updatedAt | Jul 4, 2024, 10:52 PM |
| githubUrl | https://github.com/neomjs/neo/issues/5529 |
| author | tobiu |
| commentsCount | 0 |
| parentIssue | null |
| subIssues | [] |
| subIssuesCompleted | 0 |
| subIssuesTotal | 0 |
| blockedBy | [] |
| blocking | [] |
| closedAt | Jul 4, 2024, 10:52 PM |
It took me many hours to figure this one out.
The bug is related to introducing flat maps for reducing the amount of tree parsings.
However, there are a couple of spots (inserting, moving or removing an item from an array), where we did modify the old vnode tree. fair game, since it will get deleted anyway.
As a result, the indexes & items inside the old flat map were no longer fully in sync.
Changing the indexes inside a map feels expensive: getting a node & parent node is easy, but for getting all items of the same parent, we need to walk through the entire map.
So, for now, I just recreated the old map for those edge-cases. Should be roughly the same performance-wise.