[PR #3831] [MERGED] PM-11310 handle email registration special circumstance after successful login #4450

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

📋 Pull Request Information

Original PR: https://github.com/bitwarden/android/pull/3831
Author: @dseverns-livefront
Created: 8/26/2024
Status: Merged
Merged: 8/28/2024
Merged by: @dseverns-livefront

Base: mainHead: PM-11310-fix-state-conflict


📝 Commits (4)

  • 79258a2 PM-11310 handle email registration special circumstance after successful login
  • b899606 Pr feedback, move observing user state to special cirumstance manager itself
  • f242bf6 fix tests
  • 836f17f add backhandler tests

📊 Changes

20 files changed (+239 additions, -68 deletions)

View changed files

📝 app/src/main/java/com/x8bit/bitwarden/MainViewModel.kt (+1 -1)
📝 app/src/main/java/com/x8bit/bitwarden/data/platform/manager/SpecialCircumstanceManagerImpl.kt (+24 -1)
📝 app/src/main/java/com/x8bit/bitwarden/data/platform/manager/di/ActivityPlatformManagerModule.kt (+10 -2)
📝 app/src/main/java/com/x8bit/bitwarden/data/platform/manager/model/SpecialCircumstance.kt (+20 -9)
📝 app/src/main/java/com/x8bit/bitwarden/data/platform/manager/util/SpecialCircumstanceExtensions.kt (+2 -2)
📝 app/src/main/java/com/x8bit/bitwarden/ui/auth/feature/completeregistration/CompleteRegistrationScreen.kt (+5 -0)
📝 app/src/main/java/com/x8bit/bitwarden/ui/auth/feature/completeregistration/CompleteRegistrationViewModel.kt (+2 -8)
📝 app/src/main/java/com/x8bit/bitwarden/ui/auth/feature/login/LoginViewModel.kt (+2 -2)
📝 app/src/main/java/com/x8bit/bitwarden/ui/platform/feature/rootnav/RootNavViewModel.kt (+2 -2)
📝 app/src/test/java/com/x8bit/bitwarden/MainViewModelTest.kt (+9 -2)
📝 app/src/test/java/com/x8bit/bitwarden/data/platform/manager/SpecialCircumstanceManagerTest.kt (+58 -1)
📝 app/src/test/java/com/x8bit/bitwarden/ui/auth/feature/completeregistration/CompleteRegistrationScreenTest.kt (+7 -1)
📝 app/src/test/java/com/x8bit/bitwarden/ui/auth/feature/completeregistration/CompleteRegistrationViewModelTest.kt (+21 -28)
📝 app/src/test/java/com/x8bit/bitwarden/ui/platform/base/BaseComposeTest.kt (+25 -0)
📝 app/src/test/java/com/x8bit/bitwarden/ui/platform/feature/rootnav/RootNavViewModelTest.kt (+12 -4)
📝 app/src/test/java/com/x8bit/bitwarden/ui/platform/feature/search/SearchViewModelTest.kt (+7 -1)
📝 app/src/test/java/com/x8bit/bitwarden/ui/platform/feature/settings/accountsecurity/loginapproval/LoginApprovalScreenTest.kt (+9 -1)
📝 app/src/test/java/com/x8bit/bitwarden/ui/tools/feature/send/addsend/AddSendScreenTest.kt (+7 -1)
📝 app/src/test/java/com/x8bit/bitwarden/ui/vault/feature/addedit/VaultAddEditViewModelTest.kt (+7 -1)
📝 app/src/test/java/com/x8bit/bitwarden/ui/vault/feature/itemlisting/VaultItemListingViewModelTest.kt (+9 -1)

📄 Description

🎟️ Tracking

https://bitwarden.atlassian.net/browse/PM-11310

📔 Objective

Currently the special circumstance for the complete registration needs to be cleared since it interferes with AuthState related state navigation. The old way we were doing this via onCleared in the CompleteRegistrationViewModel was causing a conflict with the nav stack emitting a state based nav call after making the explicit call to go to the login screen.

  • Categorize a PreLogin type of SpecialCircumstance
  • Add function to manager to handle clearing a special circumstance after successful login.
  • Observe user state change to update.

📸 Screenshots

https://github.com/user-attachments/assets/9bd6333b-c424-4984-8ddf-3438e1420504

Reminders before review

  • Contributor guidelines followed
  • All formatters and local linters executed and passed
  • Written new unit and / or integration tests where applicable
  • Used internationalization (i18n) for all UI strings
  • CI builds passed
  • Communicated to DevOps any deployment requirements
  • Updated any necessary documentation or informed the documentation team

🦮 Reviewer guidelines

  • 👍 (:+1:) or similar for great changes
  • 📝 (:memo:) or ℹ️ (:information_source:) for notes or general info
  • (:question:) for questions
  • 🤔 (:thinking:) or 💭 (:thought_balloon:) for more open inquiry that's not quite a confirmed
    issue and could potentially benefit from discussion
  • 🎨 (:art:) for suggestions / improvements
  • (:x:) or ⚠️ (:warning:) for more significant problems or concerns needing attention
  • 🌱 (:seedling:) or ♻️ (:recycle:) for future improvements or indications of technical debt
  • ⛏ (:pick:) for minor or nitpick changes

🔄 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/3831 **Author:** [@dseverns-livefront](https://github.com/dseverns-livefront) **Created:** 8/26/2024 **Status:** ✅ Merged **Merged:** 8/28/2024 **Merged by:** [@dseverns-livefront](https://github.com/dseverns-livefront) **Base:** `main` ← **Head:** `PM-11310-fix-state-conflict` --- ### 📝 Commits (4) - [`79258a2`](https://github.com/bitwarden/android/commit/79258a2c513e6489a9639accbcf70784a4435f21) PM-11310 handle email registration special circumstance after successful login - [`b899606`](https://github.com/bitwarden/android/commit/b89960656e97f212b4b21c6292b17f239b8ce7ca) Pr feedback, move observing user state to special cirumstance manager itself - [`f242bf6`](https://github.com/bitwarden/android/commit/f242bf6eb2fd7adb9785c4e3f2a05a7a9eb9ee05) fix tests - [`836f17f`](https://github.com/bitwarden/android/commit/836f17f8027fd39ae5128e99ae539ccdf44871aa) add backhandler tests ### 📊 Changes **20 files changed** (+239 additions, -68 deletions) <details> <summary>View changed files</summary> 📝 `app/src/main/java/com/x8bit/bitwarden/MainViewModel.kt` (+1 -1) 📝 `app/src/main/java/com/x8bit/bitwarden/data/platform/manager/SpecialCircumstanceManagerImpl.kt` (+24 -1) 📝 `app/src/main/java/com/x8bit/bitwarden/data/platform/manager/di/ActivityPlatformManagerModule.kt` (+10 -2) 📝 `app/src/main/java/com/x8bit/bitwarden/data/platform/manager/model/SpecialCircumstance.kt` (+20 -9) 📝 `app/src/main/java/com/x8bit/bitwarden/data/platform/manager/util/SpecialCircumstanceExtensions.kt` (+2 -2) 📝 `app/src/main/java/com/x8bit/bitwarden/ui/auth/feature/completeregistration/CompleteRegistrationScreen.kt` (+5 -0) 📝 `app/src/main/java/com/x8bit/bitwarden/ui/auth/feature/completeregistration/CompleteRegistrationViewModel.kt` (+2 -8) 📝 `app/src/main/java/com/x8bit/bitwarden/ui/auth/feature/login/LoginViewModel.kt` (+2 -2) 📝 `app/src/main/java/com/x8bit/bitwarden/ui/platform/feature/rootnav/RootNavViewModel.kt` (+2 -2) 📝 `app/src/test/java/com/x8bit/bitwarden/MainViewModelTest.kt` (+9 -2) 📝 `app/src/test/java/com/x8bit/bitwarden/data/platform/manager/SpecialCircumstanceManagerTest.kt` (+58 -1) 📝 `app/src/test/java/com/x8bit/bitwarden/ui/auth/feature/completeregistration/CompleteRegistrationScreenTest.kt` (+7 -1) 📝 `app/src/test/java/com/x8bit/bitwarden/ui/auth/feature/completeregistration/CompleteRegistrationViewModelTest.kt` (+21 -28) 📝 `app/src/test/java/com/x8bit/bitwarden/ui/platform/base/BaseComposeTest.kt` (+25 -0) 📝 `app/src/test/java/com/x8bit/bitwarden/ui/platform/feature/rootnav/RootNavViewModelTest.kt` (+12 -4) 📝 `app/src/test/java/com/x8bit/bitwarden/ui/platform/feature/search/SearchViewModelTest.kt` (+7 -1) 📝 `app/src/test/java/com/x8bit/bitwarden/ui/platform/feature/settings/accountsecurity/loginapproval/LoginApprovalScreenTest.kt` (+9 -1) 📝 `app/src/test/java/com/x8bit/bitwarden/ui/tools/feature/send/addsend/AddSendScreenTest.kt` (+7 -1) 📝 `app/src/test/java/com/x8bit/bitwarden/ui/vault/feature/addedit/VaultAddEditViewModelTest.kt` (+7 -1) 📝 `app/src/test/java/com/x8bit/bitwarden/ui/vault/feature/itemlisting/VaultItemListingViewModelTest.kt` (+9 -1) </details> ### 📄 Description ## 🎟️ Tracking https://bitwarden.atlassian.net/browse/PM-11310 <!-- Paste the link to the Jira or GitHub issue or otherwise describe / point to where this change is coming from. --> ## 📔 Objective Currently the special circumstance for the complete registration needs to be cleared since it interferes with AuthState related state navigation. The old way we were doing this via `onCleared` in the `CompleteRegistrationViewModel` was causing a conflict with the nav stack emitting a state based nav call after making the explicit call to go to the login screen. - Categorize a `PreLogin` type of `SpecialCircumstance` - Add function to manager to handle clearing a special circumstance after successful login. - Observe user state change to update. <!-- Describe what the purpose of this PR is, for example what bug you're fixing or new feature you're adding. --> ## 📸 Screenshots https://github.com/user-attachments/assets/9bd6333b-c424-4984-8ddf-3438e1420504 <!-- Required for any UI changes; delete if not applicable. Use fixed width images for better display. --> ## ⏰ Reminders before review - Contributor guidelines followed - All formatters and local linters executed and passed - Written new unit and / or integration tests where applicable - Used internationalization (i18n) for all UI strings - CI builds passed - Communicated to DevOps any deployment requirements - Updated any necessary documentation or informed the documentation team ## 🦮 Reviewer guidelines <!-- Suggested interactions but feel free to use (or not) as you desire! --> - 👍 (`:+1:`) or similar for great changes - 📝 (`:memo:`) or ℹ️ (`:information_source:`) for notes or general info - ❓ (`:question:`) for questions - 🤔 (`:thinking:`) or 💭 (`:thought_balloon:`) for more open inquiry that's not quite a confirmed issue and could potentially benefit from discussion - 🎨 (`:art:`) for suggestions / improvements - ❌ (`:x:`) or ⚠️ (`:warning:`) for more significant problems or concerns needing attention - 🌱 (`:seedling:`) or ♻️ (`:recycle:`) for future improvements or indications of technical debt - ⛏ (`:pick:`) for minor or nitpick changes --- <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:44:38 -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#4450