Frontmatter
| id | 8099 |
| title | Fix initialIndexSymbol assignment in Neo.collection.Base |
| state | Closed |
| labels | bugai |
| assignees | tobiu |
| createdAt | Dec 12, 2025, 10:39 PM |
| updatedAt | Dec 12, 2025, 10:42 PM |
| githubUrl | https://github.com/neomjs/neo/issues/8099 |
| author | tobiu |
| commentsCount | 0 |
| parentIssue | null |
| subIssues | [] |
| subIssuesCompleted | 0 |
| subIssuesTotal | 0 |
| contentTrust | |
| projected | |
| quarantined | 0 |
| signals | [] |
| blockedBy | [] |
| blocking | [] |
| closedAt | Dec 12, 2025, 10:42 PM |
Problem
The
splicemethod inNeo.collection.Basewas unconditionally assigning theinitialIndexSymbolto all added items if they didn't already have it.// Previous Logic if (!Object.hasOwn(item, initialIndexSymbol)) { item[initialIndexSymbol] = me.initialIndexCounter++ }This caused plain objects in generic collections to be polluted with this symbol, leading to unit test failures in
Neo.collection.Base.Solution
Invert the logic to only assign the index counter if the item already possesses the symbol key (which
Neo.data.Recordinstances do, initialized tonull).// New Logic if (Object.hasOwn(item, initialIndexSymbol)) { item[initialIndexSymbol] = me.initialIndexCounter++ }This ensures the feature is "opt-in" and works correctly for
Neo.data.Store(where records have the symbol) while ignoring plain objects in standard collections.