[PR #1818] [MERGED] Fixed migration and account removal issues #3153

Closed
opened 2025-11-26 23:28:59 -06:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/bitwarden/android/pull/1818
Author: @mpbw2
Created: 2/28/2022
Status: Merged
Merged: 2/28/2022
Merged by: @mpbw2

Base: masterHead: bugfixes


📝 Commits (1)

  • a4d4f9e fixed migration and account removal issues

📊 Changes

3 files changed (+13 additions, -9 deletions)

View changed files

📝 src/App/Pages/Accounts/LoginPage.xaml.cs (+4 -2)
📝 src/Core/Services/StateMigrationService.cs (+7 -7)
📝 src/Core/Services/StateService.cs (+2 -0)

📄 Description

Type of change

  • Bug fix
  • New feature development
  • Tech debt (refactoring, code cleanup, dependency upgrades, etc)
  • Build/deploy pipeline (DevOps)
  • Other

Objective

Fixed issue where migration was skipped when using default environment, "Remove Account" was shown on iOS when it shouldn't be, and creating a new account was not carrying forward the current DisableFavicon setting

Code changes

  • LoginPage.xaml.cs: Only show "Remove Account" in the iOS action sheet when _email is disabled (same condition as Android)
  • StateMigrationService.cs: Check for existence of standalone userId to signify v2 and trigger migration to v3 (was previously checking if envUrls were stored in Prefs (instead of LiteDb) but those particular prefs are only saved when a custom env is set on the Environment page (which I always did throughout the dev process, classic) so the migrator assumed it was a fresh install and never ran
  • StateService.cs: Copy the current DisableFavicon setting when creating a new account (same approach as theme)

Testing requirements

  • Remove existing installation to clear data
  • Install v2.16.2 (1434) via TestFlight and login + configure any settings
  • Install latest TestFlight build over top and observe migration

Before you submit

  • I have added unit tests where it makes sense to do so (encouraged but not required)
  • This change requires a documentation update (notify the documentation team)
  • This change has particular deployment requirements (notify the DevOps team)

🔄 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/bitwarden/android/pull/1818 **Author:** [@mpbw2](https://github.com/mpbw2) **Created:** 2/28/2022 **Status:** ✅ Merged **Merged:** 2/28/2022 **Merged by:** [@mpbw2](https://github.com/mpbw2) **Base:** `master` ← **Head:** `bugfixes` --- ### 📝 Commits (1) - [`a4d4f9e`](https://github.com/bitwarden/android/commit/a4d4f9e0244e1d95372b0dc1a7d3cc0af4aee024) fixed migration and account removal issues ### 📊 Changes **3 files changed** (+13 additions, -9 deletions) <details> <summary>View changed files</summary> 📝 `src/App/Pages/Accounts/LoginPage.xaml.cs` (+4 -2) 📝 `src/Core/Services/StateMigrationService.cs` (+7 -7) 📝 `src/Core/Services/StateService.cs` (+2 -0) </details> ### 📄 Description ## Type of change - [X] Bug fix - [ ] New feature development - [ ] Tech debt (refactoring, code cleanup, dependency upgrades, etc) - [ ] Build/deploy pipeline (DevOps) - [ ] Other ## Objective <!--Describe what the purpose of this PR is. For example: what bug you're fixing or what new feature you're adding--> Fixed issue where migration was skipped when using default environment, "Remove Account" was shown on iOS when it shouldn't be, and creating a new account was not carrying forward the current `DisableFavicon` setting ## Code changes <!--Explain the changes you've made to each file or major component. This should help the reviewer understand your changes--> <!--Also refer to any related changes or PRs in other repositories--> * **LoginPage.xaml.cs:** Only show "Remove Account" in the iOS action sheet when `_email` is disabled (same condition as Android) * **StateMigrationService.cs:** Check for existence of standalone `userId` to signify v2 and trigger migration to v3 (was previously checking if `envUrls` were stored in Prefs (instead of LiteDb) but those particular prefs are only saved when a custom env is set on the Environment page (which I always did throughout the dev process, classic) so the migrator assumed it was a fresh install and never ran * **StateService.cs:** Copy the current `DisableFavicon` setting when creating a new account (same approach as theme) ## Testing requirements <!--What functionality requires testing by QA? This includes testing new behavior and regression testing--> - Remove existing installation to clear data - Install v2.16.2 (1434) via TestFlight and login + configure any settings - Install latest TestFlight build over top and observe migration ## Before you submit - [ ] I have added **unit tests** where it makes sense to do so (encouraged but not required) - [ ] This change requires a **documentation update** (notify the documentation team) - [ ] This change has particular **deployment requirements** (notify the DevOps team) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2025-11-26 23:28:59 -06:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/android#3153