LearnNewsExamplesServices
Frontmatter
id9069
titleRefactor: Collection.Base to use getKey() hook for Turbo Mode Support
stateClosed
labels
bugcore
assigneestobiu
createdAtFeb 9, 2026, 3:48 AM
updatedAtFeb 9, 2026, 3:55 AM
githubUrlhttps://github.com/neomjs/neo/issues/9069
authortobiu
commentsCount1
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtFeb 9, 2026, 3:55 AM

Refactor: Collection.Base to use getKey() hook for Turbo Mode Support

Closed v12.0.0 bugcore
tobiu
tobiu commented on Feb 9, 2026, 3:48 AM

Problem: accesses directly. In Turbo Mode (Store), we use mapped keys (e.g. but raw data has ). Direct access returns , causing the Collection to generate negative IDs (, ) for items.

Solution:

  1. Refactor : Introduce method (defaulting to direct access).
  2. Update : Replace all internal direct key access with .
  3. : Ensure its existing override correctly handles the Reverse Mapping (Canonical -> Raw) logic.

Result: The Collection will correctly resolve keys from Raw Objects even when using Canonical Key Properties, fixing the Grid ID regression without breaking Selection Models.

tobiu assigned to @tobiu on Feb 9, 2026, 3:48 AM
tobiu added the bug label on Feb 9, 2026, 3:48 AM
tobiu added the core label on Feb 9, 2026, 3:48 AM
tobiu changed title from Fix: Grid IDs Regression & Store.getKey Reverse Mapping Support to Refactor: Collection.Base to use getKey() hook for Turbo Mode Support on Feb 9, 2026, 3:50 AM
tobiu
tobiu Feb 9, 2026, 3:55 AM

Input from Gemini 3 Pro:

✦ I have resolved the regression where the Grid was displaying negative IDs (-1, -2).

Analysis:

  • Root Cause: Neo.collection.Base accessed item[this.keyProperty] directly. In "Turbo Mode" (Store), keyProperty is 'login', but the raw item only has 'l'. Direct access returned undefined, causing the Collection to generate new negative IDs.
  • Solution: Refactored Neo.collection.Base to use a getKey(item) method (defaulting to direct access). This allows Neo.data.Store (which overrides getKey) to inject its smart "Reverse Mapping" logic (added in #9067).

Changes:

  1. Refactored src/collection/Base.mjs: Replaced direct keyProperty access with getKey(item).
  2. App Config: Contributors.mjs remains keyProperty: 'login' (canonical), ensuring architectural correctness.

Result: The Grid now correctly identifies records using the mapped key (l -> login), displaying positive IDs and allowing correct selection behavior.

tobiu referenced in commit 549c442 - "Refactor: Collection.Base to use getKey() hook for Turbo Mode Support (#9069)" on Feb 9, 2026, 3:55 AM
tobiu closed this issue on Feb 9, 2026, 3:55 AM