Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Track favorites on a per-user basis #1106

Merged
merged 3 commits into from
Aug 23, 2020
Merged

Conversation

jjlin
Copy link
Contributor

@jjlin jjlin commented Aug 19, 2020

Currently, favorites are tracked at the cipher level. For org-owned ciphers,
this means that if one user sets it as a favorite, it automatically becomes a
favorite for all other users that the cipher has been shared with.

Fixes #885.

jjlin added 2 commits August 19, 2020 02:32
Currently, favorites are tracked at the cipher level. For org-owned ciphers,
this means that if one user sets it as a favorite, it automatically becomes a
favorite for all other users that the cipher has been shared with.
@dani-garcia
Copy link
Owner

Sounds good to me but we should migrate the favorites for user owned ciphers at least, the favorites for the org ciphers can be ignored as they are probably wrong.

@jjlin
Copy link
Contributor Author

jjlin commented Aug 22, 2020

Okay, I think that should be doable.

#[cfg(feature = "sqlite")]
diesel::sql_query("PRAGMA defer_foreign_keys = ON").execute(&connection).expect("Failed to disable Foreign Key Checks during migrations");
diesel::sql_query("PRAGMA foreign_keys = OFF").execute(&connection).expect("Failed to disable Foreign Key Checks during migrations");
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that PRAGMA defer_foreign_keys doesn't work here because it's automatically turned off at the end of a transaction [1], so it's actually only in effect for the first migration.

[1] https://sqlite.org/pragma.html#pragma_defer_foreign_keys

@dani-garcia dani-garcia merged commit 1988918 into dani-garcia:master Aug 23, 2020
@jjlin jjlin deleted the favorites branch August 23, 2020 22:58
thelittlefireman pushed a commit to thelittlefireman/bitwarden_rs that referenced this pull request Mar 19, 2021
Track favorites on a per-user basis
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Favorites are tracked at cipher level rather than on a per-user basis
2 participants