-
-
Notifications
You must be signed in to change notification settings - Fork 202
Refactor: Global Audit & Fix for 'keyProperty' Access (Turbo Mode Compatibility) #9068
Copy link
Copy link
Closed
Closed
Copy link
Labels
coreCore framework functionalityCore framework functionality
Description
Context:
The introduction of "Turbo Mode" (autoInitRecords: false) combined with Model Field Mapping has exposed a critical architectural vulnerability.
- Turbo Mode: The Store holds Raw Objects (POJOs) to save memory.
- Mapping: The Raw Object keys (e.g.
'l') differ from the Model's canonical field names (e.g.'login'). - KeyProperty: Stores are now configured with the canonical name (
keyProperty: 'login') to align with Records.
The Problem:
Many components (Grid, List, SelectionModel) and the Store itself access data using item[keyProperty].
- On Raw Object:
item['login']isundefined. (It has'l'). - On Record:
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 where keyProperty or getKeyProperty() is used to access object properties directly.
Replace them with store.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.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
coreCore framework functionalityCore framework functionality