[PR #2246] [MERGED] [EC-844] Improve Apple Watch states #33955

Closed
opened 2026-04-21 01:37:44 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/bitwarden/android/pull/2246
Author: @fedemkr
Created: 12/15/2022
Status: Merged
Merged: 12/15/2022
Merged by: @fedemkr

Base: masterHead: EC-844-watch-login-setup-states-impr


📝 Commits (3)

  • 76962c5 EC-844 improve need login / need setup states on the watch
  • d38b900 Merge branch 'master' into EC-844-watch-login-setup-states-impr
  • bb3ee7d EC-844 Fix naming of things and moved constant to the proper place to maintain format. Also removed UpdateLastUserShouldConnectToWatchAsync from the interface of the StateService given that it's not used outside the service and made it private

📊 Changes

5 files changed (+30 additions, -10 deletions)

View changed files

📝 src/App/Services/BaseWatchDeviceService.cs (+7 -4)
📝 src/Core/Abstractions/IStateService.cs (+1 -0)
📝 src/Core/Constants.cs (+5 -0)
📝 src/Core/Services/StateService.cs (+17 -0)
📝 src/watchOS/bitwarden/bitwarden WatchKit Extension/ViewModels/CipherListViewModel.swift (+0 -6)

📄 Description

Type of change

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

Objective

On Apple Watch there's an overlap between the "Need Log in" / "Need set up" states, so this PR goal is to fix them so that:

  • Need Set up => first time of the app until log in and "Connect to Watch" is turned on or if the last account has turned off "Connect to Watch"
  • Need Log in => if the last logged out account had "Connect to Watch" still enabled when logging out

Code changes

  • BaseWatchDeviceService: Improved state logic to include the last active account value of "Connect to Watch" to determine whether to be in "Need Log in" state
  • StateService: Added setting for LastUserShouldConnectToWatch which stands for the value of ShouldConnectToWatch of the last active user. Also, updates it accordingly when the active user changes and when the "Connect to Watch" value changes.
  • Watch -> CipherListViewModel: Removed logic for NeedSetup when no user is found on the watch, given that it's not needed anymore with the additional logic on the iOS app.

Before you submit

  • Please check for formatting errors (dotnet format --verify-no-changes) (required)
  • Please add unit tests where it makes sense to do so (encouraged but not required)
  • If this change requires a documentation update - notify the documentation team
  • If 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/2246 **Author:** [@fedemkr](https://github.com/fedemkr) **Created:** 12/15/2022 **Status:** ✅ Merged **Merged:** 12/15/2022 **Merged by:** [@fedemkr](https://github.com/fedemkr) **Base:** `master` ← **Head:** `EC-844-watch-login-setup-states-impr` --- ### 📝 Commits (3) - [`76962c5`](https://github.com/bitwarden/android/commit/76962c5ba193e3c6ff91424cfcd18d7f8174693a) EC-844 improve need login / need setup states on the watch - [`d38b900`](https://github.com/bitwarden/android/commit/d38b900b757155f901dd2c43e857de04bc3ddef9) Merge branch 'master' into EC-844-watch-login-setup-states-impr - [`bb3ee7d`](https://github.com/bitwarden/android/commit/bb3ee7d511593cace925ab6b2eb408baeb88c8d7) EC-844 Fix naming of things and moved constant to the proper place to maintain format. Also removed UpdateLastUserShouldConnectToWatchAsync from the interface of the StateService given that it's not used outside the service and made it private ### 📊 Changes **5 files changed** (+30 additions, -10 deletions) <details> <summary>View changed files</summary> 📝 `src/App/Services/BaseWatchDeviceService.cs` (+7 -4) 📝 `src/Core/Abstractions/IStateService.cs` (+1 -0) 📝 `src/Core/Constants.cs` (+5 -0) 📝 `src/Core/Services/StateService.cs` (+17 -0) 📝 `src/watchOS/bitwarden/bitwarden WatchKit Extension/ViewModels/CipherListViewModel.swift` (+0 -6) </details> ### 📄 Description ## Type of change - [ ] Bug fix - [X] 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--> On Apple Watch there's an overlap between the "Need Log in" / "Need set up" states, so this PR goal is to fix them so that: - Need Set up => first time of the app until log in and "Connect to Watch" is turned on or if the last account has turned off "Connect to Watch" - Need Log in => if the last logged out account had "Connect to Watch" still enabled when logging out ## 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--> * **BaseWatchDeviceService:** Improved state logic to include the last active account value of "Connect to Watch" to determine whether to be in "Need Log in" state * **StateService:** Added setting for `LastUserShouldConnectToWatch` which stands for the value of `ShouldConnectToWatch` of the last active user. Also, updates it accordingly when the active user changes and when the "Connect to Watch" value changes. * **Watch -> CipherListViewModel:** Removed logic for `NeedSetup` when no user is found on the watch, given that it's not needed anymore with the additional logic on the iOS app. ## Before you submit - Please check for formatting errors (`dotnet format --verify-no-changes`) (required) - Please add **unit tests** where it makes sense to do so (encouraged but not required) - If this change requires a **documentation update** - notify the documentation team - If 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 2026-04-21 01:37:44 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/android#33955