[PR #6564] [PM-32566] Refactor cookie acquisition ViewModel and simplify tests #12822

Closed
opened 2026-04-11 03:51:51 -05:00 by GiteaMirror · 0 comments
Owner

Original Pull Request: https://github.com/bitwarden/android/pull/6564

State: closed
Merged: Yes


🎟️ Tracking

PM-32566

📔 Objective

Refactor the cookie acquisition flow to simplify hostname derivation and improve reliability:

  • Add hostname to CookieAcquisitionState: Snapshot the hostname via requireNotNull at ViewModel init time, since MainViewModel guarantees the request is non-null when navigating to this screen.
  • Add filterNotNull to MainViewModel: Prevent the cookie acquisition screen from being navigated to on the initial null emission of the StateFlow.
  • Move AuthTabData construction into ViewModel: Follow the established pattern from EnterpriseSignOnViewModel where the event carries all data needed by the screen.
  • Simplify CookieUtilsTest: Remove duplicate cookie-parsing tests from the Intent extension section (covered by Uri extension tests), and replace lateinit/@BeforeEach with inline property initialization.
**Original Pull Request:** https://github.com/bitwarden/android/pull/6564 **State:** closed **Merged:** Yes --- ## 🎟️ Tracking PM-32566 ## 📔 Objective Refactor the cookie acquisition flow to simplify hostname derivation and improve reliability: - Add hostname to CookieAcquisitionState: Snapshot the hostname via requireNotNull at ViewModel init time, since MainViewModel guarantees the request is non-null when navigating to this screen. - Add filterNotNull to MainViewModel: Prevent the cookie acquisition screen from being navigated to on the initial null emission of the StateFlow. - Move AuthTabData construction into ViewModel: Follow the established pattern from EnterpriseSignOnViewModel where the event carries all data needed by the screen. - Simplify CookieUtilsTest: Remove duplicate cookie-parsing tests from the Intent extension section (covered by Uri extension tests), and replace `lateinit/@BeforeEach` with inline property initialization.
GiteaMirror added the pull-request label 2026-04-11 03:51:51 -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#12822