mirror of
https://github.com/dani-garcia/vaultwarden.git
synced 2026-03-12 01:45:56 -05:00
[PR #4517] [MERGED] Pass in collection ids to notifier when sharing cipher. #7084
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/dani-garcia/vaultwarden/pull/4517
Author: @kristof-mattei
Created: 4/19/2024
Status: ✅ Merged
Merged: 4/27/2024
Merged by: @dani-garcia
Base:
main← Head:share-to-org-notification📝 Commits (1)
df1bbc5Pass in collection ids to notifier when sharing cipher.📊 Changes
3 files changed (+19 additions, -12 deletions)
View changed files
📝
src/api/core/accounts.rs(+1 -1)📝
src/api/core/ciphers.rs(+17 -10)📝
src/api/core/organizations.rs(+1 -1)📄 Description
(sorry about hitting publish too soon).
This PR fixes a bug where moving a cipher from a personal vault to an organization does not attach the collection ids of which the cipher is now a member.
The front-end relies on these if the notification type is
NotificationType.SyncCipherUpdate(91f1d9fb86/libs/common/src/services/notifications.service.ts (L150)) which in turn controlsisEditinsyncUpsertCipher(91f1d9fb86/libs/common/src/vault/services/sync/sync.service.ts (L177)). IfisEditistrue(we moved a cipher, we didn't create one) we need thecollectionIdsotherwiseshouldUpdateremainsfalse(91f1d9fb86/libs/common/src/vault/services/sync/sync.service.ts (L213)).This causes a client on the receiving side to fail to properly update its view, requiring a manual refresh.
Before:
https://github.com/dani-garcia/vaultwarden/assets/864376/d2e0d455-2bd6-476f-823c-b357f0bd2f15
After:
https://github.com/dani-garcia/vaultwarden/assets/864376/8e08a0bd-9ea6-4bda-b1e8-67ab7e68514a
I chose
Option<Vec<String>>because that's what the notifier service takes, even though technically we could doVec<String>but that makes it much uglier for other consumers. Passing inNoneis much nicer thanvec![].🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.