[PM-33951] automatically confirm pending users on admin login#20331
Conversation
- Introduced methods to retrieve pending auto-confirm users and to bulk auto-confirm them in the OrganizationUserApiService. - Added OrganizationUserPendingAutoConfirmResponse model to handle responses for pending auto-confirmation. - Implemented logic in DefaultAutomaticUserConfirmationService to automatically confirm users who accepted their invitations while the admin was offline. - Updated feature flags to enable bulk auto-confirmation on login. These changes enhance the user management experience by streamlining the confirmation process for organization users.
…m-33919-automatically-confirm-pending-users-on-admin-login
…nd configService dependencies to the constructor. This update improves service integration for background operations.
- Implemented the `initBulkAutoConfirmOnLoginSweep` method in `DefaultAutomaticUserConfirmationService` to trigger bulk auto-confirmation for users transitioning from Locked to Unlocked status. - Enhanced unit tests to verify the behavior of the sweep service under different authentication states. - Updated the service to utilize `AuthenticationStatus` for improved state management during user confirmation processes. These changes streamline the user confirmation workflow, ensuring timely processing of pending confirmations upon user login.
|
@claude review please |
|
Claude finished @JaredScar's task in 4m 26s —— View job Claude Code Review
Overall the change is well-scoped and tested. The feature flag gating and the guard rails ( 🟠 Potentially duplicate sweeps on every
|
🤖 Bitwarden Claude Code ReviewOverall Assessment: APPROVE Reviewed the bulk auto-confirm-on-login feature added to Code Review DetailsNo findings to flag. Notes from analysis (informational, not findings):
|
|
Great job! No new security vulnerabilities introduced in this pull request |
|
@JaredScar Tests are failing ❌ |
…nfirmation handling - Updated the `initBulkAutoConfirmOnLoginSweep` method to utilize a set for tracking seen user IDs, preventing duplicate processing during user state transitions. - Enhanced error handling in the bulk auto-confirmation process to gracefully manage transient errors. - Introduced a new `resolveAutoConfirmOrg` method to streamline organization retrieval logic for user confirmation. - Updated unit tests to reflect changes in the handling of account information and ensure correct behavior during user confirmation processes. These modifications enhance the efficiency and reliability of the user confirmation workflow, particularly during login transitions.
…ers-on-admin-login
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #20331 +/- ##
==========================================
+ Coverage 47.09% 47.11% +0.01%
==========================================
Files 3938 3939 +1
Lines 119600 119659 +59
Branches 18350 18357 +7
==========================================
+ Hits 56329 56376 +47
- Misses 59006 59015 +9
- Partials 4265 4268 +3 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
@claude please re-review |
…m-33919-automatically-confirm-pending-users-on-admin-login
|
@claude Where is my re-review? |
…idate feature flag behavior. Added checks to ensure subscriptions are not set up when the feature flag is disabled and confirmed correct behavior during user state transitions. Updated the `initBulkAutoConfirmOnLoginSweep` method to be asynchronous for proper feature flag handling.
| this.accountService.accounts$ | ||
| .pipe( | ||
| mergeMap((accounts) => { | ||
| const newUserIds = Object.keys(accounts).filter((id) => !seenUserIds.has(id)); |
There was a problem hiding this comment.
Do we need to deduplicate here? This observable should returns a list of AccountInfo where each key is an UserId, and the AddAccount method in the service doesn't seem to allow for duplicates at all
There was a problem hiding this comment.
We do because accounts$ is a snapshot feed. Any time something about the account changes, a whole map of accounts is pushed out to this observable... Therefore, we need to make sure we deduplicate here to prevent tracking the same user ID more than once.
…m-33919-automatically-confirm-pending-users-on-admin-login
…ers-on-admin-login
Changes in this PR impact the Autofill experience of the browser clientBIT has tested the core experience with these changes and all feature flags disabled. ✅ Fortunately, these BIT tests have passed! 🎉 |
Changes in this PR impact the Autofill experience of the browser clientBIT has tested the core experience with these changes and the feature flag configuration used by ✅ Fortunately, these BIT tests have passed! 🎉 |
…ers-on-admin-login
|




🎟️ Tracking
https://bitwarden.atlassian.net/browse/PM-33951
📔 Objective
When an admin logins to the browser extension for an organization, we want users who accepted an invite to be confirmed as users automatically. When the extension is locked, unlocking should also proceed to accept the users pending confirmation.