From d9d313e498ae54995da7920f764a79e1803be2c8 Mon Sep 17 00:00:00 2001 From: Nick Krantz Date: Wed, 9 Oct 2024 13:12:31 -0500 Subject: [PATCH] update the cipher revision date when an attachment is added or deleted --- .../Vault/Services/Implementations/CipherService.cs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/Core/Vault/Services/Implementations/CipherService.cs b/src/Core/Vault/Services/Implementations/CipherService.cs index d6947b5412..f2cb695392 100644 --- a/src/Core/Vault/Services/Implementations/CipherService.cs +++ b/src/Core/Vault/Services/Implementations/CipherService.cs @@ -210,6 +210,10 @@ public class CipherService : ICipherService AttachmentData = JsonSerializer.Serialize(data) }); cipher.AddAttachment(attachmentId, data); + + // Update the revision date when an attachment is added + cipher.RevisionDate = DateTime.UtcNow; + await _pushService.PushSyncCipherUpdateAsync(cipher, null); return (attachmentId, uploadUrl); @@ -259,6 +263,9 @@ public class CipherService : ICipherService throw; } + // Update the revision date when an attachment is added + cipher.RevisionDate = DateTime.UtcNow; + // push await _pushService.PushSyncCipherUpdateAsync(cipher, null); } @@ -1021,6 +1028,9 @@ public class CipherService : ICipherService await _attachmentStorageService.DeleteAttachmentAsync(cipher.Id, attachmentData); await _eventService.LogCipherEventAsync(cipher, Bit.Core.Enums.EventType.Cipher_AttachmentDeleted); + // Update the revision date when an attachment is deleted + cipher.RevisionDate = DateTime.UtcNow; + // push await _pushService.PushSyncCipherUpdateAsync(cipher, null); }