Conversation
… feat/record-nodes-internal-id
|
… feat/record-nodes-internal-id
There was a problem hiding this comment.
Pull request overview
This pull request implements a significant architectural change by replacing UUID-based node identification with internal ID-based identification within records. This change aims to improve performance and simplify the codebase by using numeric internal IDs (unique within a record) instead of UUIDs for node relationships and indexing.
Changes:
- Replaced
node.uuidwithnode.iId(internal ID) andnode.parentUuidwithnode.pIId(parent internal ID) - Updated Record model to track nodes by internal IDs and maintain
lastInternalIdfor ID generation - Simplified RecordCloner by eliminating UUID remapping logic - internal IDs remain stable during cloning
- Converted multiple
forEachloops tofor...offor consistency and potential performance improvements
Reviewed changes
Copilot reviewed 58 out of 59 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| src/node/node.ts | Updated Node interface to use iId and pIId instead of uuid and parentUuid, added documentation |
| src/node/factory.ts | Modified NodeFactory to generate internal IDs based on record.lastInternalId |
| src/node/nodes.ts | Updated utility functions to use internal IDs for node comparison and hierarchy |
| src/record/record.ts | Changed Record interface to index nodes by internal IDs and added lastInternalId tracking |
| src/record/records.ts | Updated public API to use getNodeByInternalId instead of getNodeByUuid |
| src/record/_records/recordGetters.ts | Refactored getters to work with internal IDs |
| src/record/_records/recordUpdater.ts | Added logic to update record.lastInternalId when nodes are added |
| src/record/_records/recordNodesIndexReader.ts | Updated index reader to return internal IDs and convert string keys to numbers |
| src/record/_records/recordNodesIndexUpdater.ts | Modified to index nodes by internal IDs with String() conversion for object keys |
| src/record/recordValidations.ts | Changed validation field keys from UUIDs to internal IDs |
| src/record/recordUpdater.ts | Updated function signatures to use internal IDs (attributeIId, nodeInternalId) |
| src/record/recordNodesUpdater/* | Updated all node updater modules to work with internal IDs |
| src/record/recordCloner.ts | Significantly simplified by removing UUID remapping logic, using structuredClone |
| src/record/recordFixer.ts | Added initInternalIds function for migration from UUID-based to internal ID-based nodes |
| src/tests/* | Updated all tests to use internal IDs |
| src/validation/validator.ts | Converted forEach to for...of loops |
| src/validation/validations.ts | Converted forEach to for...of loops |
| src/survey/* | Converted forEach to for...of loops throughout |
| src/node/service.ts | Updated NodeService interface to use nodeInternalId instead of nodeUuid |
| src/registry/tests/node.ts | Updated mock to create nodes with records for internal ID generation |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 60 out of 61 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 64 out of 65 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
… feat/record-nodes-internal-id
|



No description provided.