Skip to content

Record nodes internal ID#293

Draft
SteRiccio wants to merge 23 commits intomasterfrom
feat/record-nodes-internal-id
Draft

Record nodes internal ID#293
SteRiccio wants to merge 23 commits intomasterfrom
feat/record-nodes-internal-id

Conversation

@SteRiccio
Copy link
Member

No description provided.

@SteRiccio SteRiccio self-assigned this Oct 21, 2025
@sonarqubecloud
Copy link

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.uuid with node.iId (internal ID) and node.parentUuid with node.pIId (parent internal ID)
  • Updated Record model to track nodes by internal IDs and maintain lastInternalId for ID generation
  • Simplified RecordCloner by eliminating UUID remapping logic - internal IDs remain stable during cloning
  • Converted multiple forEach loops to for...of for 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.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@sonarqubecloud
Copy link

sonarqubecloud bot commented Mar 2, 2026

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants