From 1ce2587330090d79c7d29d66ea6786b866e9e6d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Garc=C3=ADa?= Date: Wed, 16 Jan 2019 19:55:14 +0100 Subject: [PATCH] Correct update cipher order: first save cipher, then cipher-folder, then notify --- src/api/core/ciphers.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/api/core/ciphers.rs b/src/api/core/ciphers.rs index d90e1a2..cf4d368 100644 --- a/src/api/core/ciphers.rs +++ b/src/api/core/ciphers.rs @@ -302,9 +302,9 @@ pub fn update_cipher_from_data( cipher.fields = data.Fields.map(|f| f.to_string()); cipher.data = type_data.to_string(); cipher.password_history = data.PasswordHistory.map(|f| f.to_string()); - - cipher.move_to_folder(data.FolderId, &headers.user.uuid, &conn)?; + cipher.save(&conn)?; + cipher.move_to_folder(data.FolderId, &headers.user.uuid, &conn)?; nt.send_cipher_update(ut, &cipher, &cipher.update_users_revision(&conn));