Skip to content

Commit

Permalink
do not delete ModelComponent objects during export (#8415)
Browse files Browse the repository at this point in the history
This was needed in the past when the original ModelComponent consisted
of the name only and a symlink object was created with the same hash.
Currently that ModelComponent always has the scope-name it's not needed
anymore.
(the trigger of this change was an unclear scenario where the
model-component wasn't there after hitting Ctrl+C during export).
  • Loading branch information
davidfirst committed Jan 18, 2024
1 parent 71205ad commit 77ae7d1
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions scopes/scope/export/export.main.runtime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -492,15 +492,7 @@ if the export fails with missing objects/versions/components, run "bit fetch --l
return mapSeries(manyObjectsPerRemote, async (objectsPerRemote: ObjectsPerRemoteExtended) => {
const { remote, idsToChangeLocally, componentsAndObjects, exportedIds } = objectsPerRemote;
const remoteNameStr = remote.name;
// on Harmony, version hashes don't change, the new versions will replace the old ones.
const removeComponentVersions = false;
const refsToRemove = await Promise.all(
idsToChangeLocally.map((id) => scope.sources.getRefsForComponentRemoval(id, removeComponentVersions))
);
scope.objects.removeManyObjects(refsToRemove.flat());
// idsToChangeLocally.forEach((id) => {
// scope.createSymlink(id, idsWithFutureScope.searchWithoutScopeAndVersion(id)?.scope || remoteNameStr);
// });

componentsAndObjects.forEach((componentObject) => scope.sources.put(componentObject));

// update lanes
Expand Down

0 comments on commit 77ae7d1

Please sign in to comment.