Frontmatter
| id | 9068 |
| title | Refactor: Global Audit & Fix for ''keyProperty'' Access (Turbo Mode Compatibility) |
| state | Closed |
| labels | core |
| assignees | tobiu |
| createdAt | Feb 9, 2026, 3:44 AM |
| updatedAt | Feb 10, 2026, 2:10 AM |
| githubUrl | https://github.com/neomjs/neo/issues/9068 |
| author | tobiu |
| commentsCount | 1 |
| parentIssue | null |
| subIssues | [] |
| subIssuesCompleted | 0 |
| subIssuesTotal | 0 |
| blockedBy | [] |
| blocking | [] |
| closedAt | Feb 10, 2026, 2:10 AM |
Refactor: Global Audit & Fix for 'keyProperty' Access (Turbo Mode Compatibility)
tobiu assigned to @tobiu on Feb 9, 2026, 3:44 AM

tobiu
Feb 9, 2026, 11:02 AM
Input from Gemini 3 Pro:
✦ Task Completed: Global Audit & Fix for 'keyProperty' Access (Turbo Mode Compatibility)
Objective: Ensure framework robustness against Mixed Mode (Raw/Record) data storage, specifically addressing the "Turbo Mode" (
autoInitRecords: false) scenario where raw object keys (e.g.,'l') differ from Model field names (e.g.,'login').Key Implementations:
Polymorphic Key Resolution (
getKey()):
- Refactored
src/data/Store.mjsandsrc/collection/Base.mjsto replace directkeyPropertyaccess withme.getKey(item).- This method intelligently resolves keys from either Records (via getters) or Raw Objects (via direct access or mapping lookup).
- Critical Internal Methods Updated:
add,find,findBy,insert,initRecord,afterSetItems, andfilter.Robust ID Parsing (
getKeyType()):
- Updated
src/list/Base.mjsto usestore.getKeyType()?.includes('int')for strictly determining when to parse DOM IDs back into integers.- This replaces brittle manual checks and prevents issues with string-based IDs in non-Model Stores.
- Propagated to:
src/component/Gallery.mjs,src/component/Helix.mjs,src/list/Component.mjs.Scope of Refactoring:
- Files Changed: 18 files across
src,apps, andexamples.- Components Updated:
Neo.list.Base,Neo.list.ComponentNeo.menu.ListNeo.component.Gallery,Neo.component.HelixNeo.tree.Accordion- Calendar views (
ColorsList,CalendarsList)- Apps/Examples Verified:
apps/realworld2,apps/covid,apps/sharedcovid,examples/component/corona*.Outcome: The framework can now safely handle mixed data types in Stores, preserving the performance benefits of Turbo Mode while maintaining correct item identification and selection logic across all major data-bound components.
tobiu closed this issue on Feb 10, 2026, 2:10 AM
Context: The introduction of "Turbo Mode" (
autoInitRecords: false) combined with Model Field Mapping has exposed a critical architectural vulnerability.'l') differ from the Model's canonical field names (e.g.'login').keyProperty: 'login') to align with Records.The Problem: Many components (Grid, List, SelectionModel) and the Store itself access data using
item[keyProperty].item['login']isundefined. (It has'l').record['l']isundefined. (It has'login').The Solution: We implemented
Neo.data.Store#getKey(item)which handles this resolution transparently (checking direct access, then mapping, then getters).Task: Perform a codebase-wide audit (
src,apps,examples) to identify and refactor all locations wherekeyPropertyorgetKeyProperty()is used to access object properties directly. Replace them withstore.getKey(item).Critical Areas:
src/data/Store.mjs(Internal methods:find,insert, etc.)src/list/Base.mjs(Item ID generation)src/grid/(Any remaining spots)examples/(To ensure demos don't break)Goal: Ensure the framework is robust against Mixed Mode (Raw/Record) data storage.