Skip to content

Commit f8a398e

Browse files
committed
Apply code review
1 parent 94e810f commit f8a398e

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

src/Core/SecureFolderFS.Core.FileSystem/Helpers/Health/HealthHelpers.Sidecar.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public static async Task DetectOrphanSidecarsAsync(IFolder folder, IProgress<IRe
2828
var shortenedNames = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
2929
var sidecars = new List<IStorableChild>();
3030

31-
await foreach (var item in folder.GetItemsAsync(StorableType.File, cancellationToken))
31+
await foreach (var item in folder.GetItemsAsync(StorableType.All, cancellationToken))
3232
{
3333
if (AbstractPathHelpers.IsSidecarName(item.Name))
3434
sidecars.Add(item);

src/Core/SecureFolderFS.Core.FileSystem/Validators/BaseFileSystemValidator.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,11 @@ protected async Task<IResult> ValidateNameResultAsync(IStorableChild storable, C
6060
if (!string.IsNullOrEmpty(decryptedName))
6161
return decryptedName;
6262

63+
// A shortened file (.sffsn) that couldn't be decrypted means its sidecar is missing.
64+
// Report this as an invalid name so the health system can offer to generate a new one.
65+
if (storable.Name.EndsWith(Constants.Names.SHORTENED_FILE_EXTENSION, StringComparison.OrdinalIgnoreCase))
66+
return null;
67+
6368
// We want to suppress failures that might be raised when the Directory ID file is not found.
6469
// This case should be already handled in the folder validator
6570

0 commit comments

Comments
 (0)