From e50fbfbc3e511e76492f91f11a837e01f25f4dd1 Mon Sep 17 00:00:00 2001 From: jaasen-livefront Date: Mon, 8 Dec 2025 10:19:11 -0800 Subject: [PATCH] update archive ciphers command to allow org ciphers to be archived --- src/Core/Vault/Commands/ArchiveCiphersCommand.cs | 2 +- .../Core.Test/Vault/Commands/ArchiveCiphersCommandTest.cs | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Core/Vault/Commands/ArchiveCiphersCommand.cs b/src/Core/Vault/Commands/ArchiveCiphersCommand.cs index 6c8e0fcf75..ad97eee20b 100644 --- a/src/Core/Vault/Commands/ArchiveCiphersCommand.cs +++ b/src/Core/Vault/Commands/ArchiveCiphersCommand.cs @@ -37,7 +37,7 @@ public class ArchiveCiphersCommand : IArchiveCiphersCommand } var archivingCiphers = ciphers - .Where(c => cipherIdsSet.Contains(c.Id) && c is { Edit: true, OrganizationId: null, ArchivedDate: null }) + .Where(c => cipherIdsSet.Contains(c.Id) && c is { Edit: true, ArchivedDate: null }) .ToList(); var revisionDate = await _cipherRepository.ArchiveAsync(archivingCiphers.Select(c => c.Id), archivingUserId); diff --git a/test/Core.Test/Vault/Commands/ArchiveCiphersCommandTest.cs b/test/Core.Test/Vault/Commands/ArchiveCiphersCommandTest.cs index d1782197d2..3bfee7709f 100644 --- a/test/Core.Test/Vault/Commands/ArchiveCiphersCommandTest.cs +++ b/test/Core.Test/Vault/Commands/ArchiveCiphersCommandTest.cs @@ -20,7 +20,7 @@ public class ArchiveCiphersCommandTest [BitAutoData(false, false, 1, 0, 1)] [BitAutoData(false, true, 1, 0, 1)] [BitAutoData(true, true, 1, 0, 1)] - public async Task ArchiveAsync_Works( + public async Task ArchiveManyAsync_Works( bool isEditable, bool hasOrganizationId, int cipherRepoCalls, int resultCountFromQuery, int pushNotificationsCalls, SutProvider sutProvider, CipherDetails cipher, User user) @@ -49,15 +49,15 @@ public class ArchiveCiphersCommandTest [Theory] [BitAutoData] - public async Task ArchiveAsync_SetsArchivedDateOnReturnedCiphers( + public async Task ArchiveManyAsync_SetsArchivedDateOnReturnedCiphers( SutProvider sutProvider, CipherDetails cipher, User user) { // Arrange: make it archivable cipher.Edit = true; - cipher.OrganizationId = null; - cipher.ArchivedDate = null; + // Allow organization cipher to be archived in this test + cipher.OrganizationId = Guid.Parse("3f2504e0-4f89-11d3-9a0c-0305e82c3301"); sutProvider.GetDependency() .GetManyByUserIdAsync(user.Id)