From b24edfac435e59187db15df3c6b5ce267ed9049b Mon Sep 17 00:00:00 2001 From: jaasen-livefront Date: Wed, 3 Dec 2025 17:12:05 -0800 Subject: [PATCH] update cipher service and tests --- src/Core/Vault/Services/Implementations/CipherService.cs | 1 + test/Core.Test/Vault/Services/CipherServiceTests.cs | 2 ++ 2 files changed, 3 insertions(+) diff --git a/src/Core/Vault/Services/Implementations/CipherService.cs b/src/Core/Vault/Services/Implementations/CipherService.cs index 2085345b16..08b86ae87c 100644 --- a/src/Core/Vault/Services/Implementations/CipherService.cs +++ b/src/Core/Vault/Services/Implementations/CipherService.cs @@ -723,6 +723,7 @@ public class CipherService : ICipherService // If the cipher was archived, clear the archived date when soft deleting // If a user were to restore an archived cipher, it should go back to the vault not the archive vault cipherDetails.ArchivedDate = null; + cipherDetails.Archives = null; } await _securityTaskRepository.MarkAsCompleteByCipherIds([cipherDetails.Id]); diff --git a/test/Core.Test/Vault/Services/CipherServiceTests.cs b/test/Core.Test/Vault/Services/CipherServiceTests.cs index c5eecb8f34..b7950b92d4 100644 --- a/test/Core.Test/Vault/Services/CipherServiceTests.cs +++ b/test/Core.Test/Vault/Services/CipherServiceTests.cs @@ -1829,6 +1829,8 @@ public class CipherServiceTests await sutProvider.Sut.SoftDeleteAsync(cipherDetails, deletingUserId); Assert.NotNull(cipherDetails.DeletedDate); + // Archives should be cleared on soft delete + Assert.Null(cipherDetails.Archives); Assert.Equal(cipherDetails.RevisionDate, cipherDetails.DeletedDate); await sutProvider.GetDependency().Received(1).UpsertAsync(cipherDetails); await sutProvider.GetDependency().Received(1).LogCipherEventAsync(cipherDetails, EventType.Cipher_SoftDeleted);