Skip to content

Commit

Permalink
fix the overriden bug
Browse files Browse the repository at this point in the history
Signed-off-by: yujin-emma <yujin.emma.work@gmail.com>
  • Loading branch information
yujin-emma committed Feb 6, 2024
1 parent b392d82 commit 9b0d78c
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,12 @@ export async function checkConflictsForDataSource({
* for import saved object from osd exported
* when the imported saved objects with the different dataSourceId comparing to the current dataSourceId
*/
if (!previoudDataSourceId || previoudDataSourceId === dataSourceId) {
if (!previoudDataSourceId) {
filteredObjects.push({
...object,
id: `${dataSourceId}_${object.id}`,
});
} else if (previoudDataSourceId === dataSourceId) {
filteredObjects.push(object);
} else if (previoudDataSourceId && previoudDataSourceId !== dataSourceId) {
if (ignoreRegularConflicts) {
Expand All @@ -70,6 +75,7 @@ export async function checkConflictsForDataSource({
const omitOriginId = ignoreRegularConflicts;
const rawId = parts[1];
importIdMap.set(`${type}:${id}`, { id: `${dataSourceId}_${rawId}`, omitOriginId });
pendingOverwrites.add(`${type}:${id}`);
filteredObjects.push({ ...object, id: `${dataSourceId}_${rawId}` });
} else {
// not override
Expand Down

0 comments on commit 9b0d78c

Please sign in to comment.