jcs / rubywarden

An unofficial, mostly Bitwarden-compatible API server written in Ruby (Sinatra and ActiveRecord)
ISC License
593 stars 49 forks source link

Deleting folder doesn't clear matching "folderId" from items #111

Closed Sudrien closed 3 years ago

Sudrien commented 4 years ago

I assume this is where this bug should be filed, as the client worked as expected before restart.

I delete a folder with items in it. Client now shows items to "No Folder". Restart client. Items now show up in "All Items", but not "No Folder".

Export shows items showing this behavior still have a "folderId" - that folder id does not show up in the folders list.

Looking at code, 549f66466ca753ee2f3c007b6e242d59dae05fdd lib/folder.rb:24 has the relation

has_many :ciphers, foreign_key: :folder_uuid, inverse_of: :folder

Which I'd expect to nullify. But doesn't seem to be. Side effect of UUIDs?