[PR #115] [MERGED] Import unique objects in the same order as the array of import sources (with fix for potential duplicates) #463

Closed
opened 2025-12-29 15:32:17 +01:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/JohnEstropia/CoreStore/pull/115
Author: @andriichernenko
Created: 10/23/2016
Status: Merged
Merged: 11/11/2016
Merged by: @JohnEstropia

Base: swift3_developHead: import-unique-objects-order


📝 Commits (3)

  • 4c3bec2 fix duplication when using importUniqueObjects with non-unique import sources
  • 970957c Merge branch 'duplicate-import-fix' into import-unique-objects-order
  • d2e78a7 add test for the order of unique object import

📊 Changes

2 files changed (+152 additions, -36 deletions)

View changed files

📝 CoreStoreTests/ImportTests.swift (+117 -0)
📝 Sources/Importing/BaseDataTransaction+Importing.swift (+35 -36)

📄 Description

Currently according to the documentation import of unique objects occurs in arbitrary order.

This behavior is different from the import of non-unique objects which might be unexpected. Furthermore, maintaining the order might be useful in some cases.

This pull request modifies importUniqueObjects(...) method to ensure that the order of import sources, order of import method calls and the order of imported objects in the returned array are the same.

This pull request is #109 combined with #111 which fixes the problem when duplicate objects are created if the array of input sources contains multiple items with the same ID.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/JohnEstropia/CoreStore/pull/115 **Author:** [@andriichernenko](https://github.com/andriichernenko) **Created:** 10/23/2016 **Status:** ✅ Merged **Merged:** 11/11/2016 **Merged by:** [@JohnEstropia](https://github.com/JohnEstropia) **Base:** `swift3_develop` ← **Head:** `import-unique-objects-order` --- ### 📝 Commits (3) - [`4c3bec2`](https://github.com/JohnEstropia/CoreStore/commit/4c3bec287c0789407522ef9417fbdf6be260f2e9) fix duplication when using importUniqueObjects with non-unique import sources - [`970957c`](https://github.com/JohnEstropia/CoreStore/commit/970957cbc2ffa979b07c4bbedb80a67eb473f8d1) Merge branch 'duplicate-import-fix' into import-unique-objects-order - [`d2e78a7`](https://github.com/JohnEstropia/CoreStore/commit/d2e78a70e1757515b91f659e6bba1b63988f4981) add test for the order of unique object import ### 📊 Changes **2 files changed** (+152 additions, -36 deletions) <details> <summary>View changed files</summary> 📝 `CoreStoreTests/ImportTests.swift` (+117 -0) 📝 `Sources/Importing/BaseDataTransaction+Importing.swift` (+35 -36) </details> ### 📄 Description Currently according to the documentation import of unique objects occurs in arbitrary order. This behavior is different from the import of non-unique objects which might be unexpected. Furthermore, maintaining the order might be useful in some cases. This pull request modifies importUniqueObjects(...) method to ensure that the order of import sources, order of import method calls and the order of imported objects in the returned array are the same. This pull request is #109 combined with #111 which fixes the problem when duplicate objects are created if the array of input sources contains multiple items with the same ID. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
adam added the pull-request label 2025-12-29 15:32:17 +01:00
adam closed this issue 2025-12-29 15:32:17 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/CoreStore#463