Skip to content

Conversation

@1pxone
Copy link
Contributor

@1pxone 1pxone commented Nov 23, 2025

No description provided.

@changeset-bot
Copy link

changeset-bot bot commented Nov 23, 2025

🦋 Changeset detected

Latest commit: d28281b

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 6 packages
Name Type
@rushdb/javascript-sdk Patch
rushdb-core Patch
rushdb-docs Patch
@rushdb/mcp-server Patch
rushdb-dashboard Patch
rushdb-website Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@1pxone 1pxone requested a review from Copilot November 23, 2025 10:11
Copilot finished reviewing on behalf of 1pxone November 23, 2025 10:14
Copy link
Contributor

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 PR fixes a deduplication issue that occurs during nested upsert operations. When a parent record is created or matched during upsert, and it references a child record that already exists (also via upsert), the relationship between them was incorrectly using draft IDs instead of the actual persisted IDs from the database.

Key Changes:

  • Introduced ID mapping from draft (serialization-time) IDs to persisted (database) IDs
  • Modified database queries to return ID mappings alongside data
  • Remapped relation references to use persisted IDs before creating relationships

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
platform/core/src/core/entity/import-export/import.service.ts Added Map to track draft-to-persisted ID mappings, extracts idmap from query results, and remaps relations before processing to ensure correct linking
platform/core/src/core/entity/entity-query.service.ts Updated both importRecords and importUpsertRecords queries to return idmap alongside data, enabling ID tracking for both create and upsert operations
packages/javascript-sdk/tests/records.importJson.upsert-nested-linking.e2e.test.ts Added e2e test verifying that when a parent upsert creates a new record, it correctly reuses and links to an existing child record
.changeset/red-boxes-float.md Added changeset documenting the deduplication fix across all affected packages

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@1pxone 1pxone merged commit 00c8ec5 into main Nov 23, 2025
@1pxone 1pxone deleted the fix/nested-upsert-deduplication-issue branch November 23, 2025 16:58
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