Skip to content

Commit

Permalink
Avoid changing root-ness of assets
Browse files Browse the repository at this point in the history
  • Loading branch information
einarmo committed Sep 9, 2024
1 parent 11df628 commit 66313a0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Extractor/Pushers/PusherUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -181,11 +181,11 @@ private static bool ShouldSetNewMetadata(FullConfig config, Dictionary<string, s
if (update.Context && !newAsset.ParentId.IsNullNodeId)
{
var parentId = extractor.GetUniqueId(newAsset.ParentId);
if (parentId != old.ParentExternalId)
// Do not move an asset from root to non-root or the other way around.
if (parentId is null == old.ParentExternalId is null
&& parentId != old.ParentExternalId)
{
#pragma warning disable CS8604 // Possible null reference argument.
assetUpdate.ParentExternalId = new UpdateNullable<string>(parentId);
#pragma warning restore CS8604 // Possible null reference argument.
assetUpdate.ParentExternalId = new UpdateNullable<string?>(parentId);
}
}

Expand Down
1 change: 1 addition & 0 deletions manifest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ versions:
fixed:
- Avoid unnecessarily repeating pushes of timeseries and references.
- Improve logging when the upload queue is full.
- Do not update whether or not an asset is a root node.
"2.30.3":
description: Fix various issues.
changelog:
Expand Down

0 comments on commit 66313a0

Please sign in to comment.