[PR #19] [MERGED] Remove dependent items when removing cipher #2575

Closed
opened 2026-03-03 02:19:50 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/dani-garcia/vaultwarden/pull/19
Author: @mprasil
Created: 5/15/2018
Status: Merged
Merged: 5/15/2018
Merged by: @dani-garcia

Base: masterHead: cipher_deleting


📝 Commits (1)

  • 21c1ab7 Remove dependent items when removing cipher

📊 Changes

6 files changed (+51 additions, -32 deletions)

View changed files

📝 src/api/core/accounts.rs (+4 -3)
📝 src/api/core/ciphers.rs (+12 -15)
📝 src/db/models/attachment.rs (+12 -6)
📝 src/db/models/cipher.rs (+11 -8)
📝 src/db/models/collection.rs (+6 -0)
📝 src/db/models/folder.rs (+6 -0)

📄 Description

This makes sure, that we delete all dependent records (Attachment, FolderCipher, CollectionCipher) before deleting Cipher itself. Otherwise the deleting will fail.

This also implements better error handling (#6) for delete and moves some functionality out of request handling under cipher.rs.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/dani-garcia/vaultwarden/pull/19 **Author:** [@mprasil](https://github.com/mprasil) **Created:** 5/15/2018 **Status:** ✅ Merged **Merged:** 5/15/2018 **Merged by:** [@dani-garcia](https://github.com/dani-garcia) **Base:** `master` ← **Head:** `cipher_deleting` --- ### 📝 Commits (1) - [`21c1ab7`](https://github.com/dani-garcia/vaultwarden/commit/21c1ab7fdaef95c6e264e792d0d3f341dd2cf10a) Remove dependent items when removing cipher ### 📊 Changes **6 files changed** (+51 additions, -32 deletions) <details> <summary>View changed files</summary> 📝 `src/api/core/accounts.rs` (+4 -3) 📝 `src/api/core/ciphers.rs` (+12 -15) 📝 `src/db/models/attachment.rs` (+12 -6) 📝 `src/db/models/cipher.rs` (+11 -8) 📝 `src/db/models/collection.rs` (+6 -0) 📝 `src/db/models/folder.rs` (+6 -0) </details> ### 📄 Description This makes sure, that we delete all dependent records (`Attachment`, `FolderCipher`, `CollectionCipher`) before deleting Cipher itself. Otherwise the deleting will fail. This also implements better error handling (#6) for `delete` and moves some functionality out of request handling under `cipher.rs`. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-03 02:19:50 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/vaultwarden#2575
No description provided.