bitwarden / ios

Bitwarden mobile app for iOS.
https://bitwarden.com
GNU General Public License v3.0
209 stars 26 forks source link

[BITAU-174] [BITAU-151] Remove shared items and key when a user disables sync #1004

Closed brant-livefront closed 1 month ago

brant-livefront commented 1 month ago

🎟ī¸ Tracking

📔 Objective

This PR cleans up the DataStore and keys when a user disables sync. When a user disables sync (after turning it on) for an account, we delete all of that account's items from the shared store. We then check to see if this was the last account to have sync turned on. If there are no other accounts with sync turned on, we then delete the main shared Authenticator key from the App Group keychain. If there are more accounts still with sync turned on, we leave the key in place.

This allows a user to turn off sync for one or all of their accounts and we clear everything up so that there's no left over data from having turned sync on.

Note: This PR is based off of the branch for this open PR. The other PR would need to be approved/merged first, or this will merge into that PR and wait for it to be approved/merge.

⏰ Reminders before review

đŸĻŽ Reviewer guidelines

codecov[bot] commented 1 month ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 89.07%. Comparing base (043c1c7) to head (1615d2e). Report is 1 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #1004 +/- ## ======================================= Coverage 89.07% 89.07% ======================================= Files 660 660 Lines 41292 41304 +12 ======================================= + Hits 36781 36793 +12 Misses 4511 4511 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

github-actions[bot] commented 1 month ago

Logo Checkmarx One – Scan Summary & Details – dcc50d9f-b764-442e-b7d5-7bbf260dd132

No New Or Fixed Issues Found

brant-livefront commented 1 month ago

@fedemkr This dismissed your approval because this was re-targeted to main once I merged the other PR in and I needed to fix some conflicts when this merged in.