Skip to content

[$175] Member Security - UI does not reflect that the unlock request was submitted. #102734

Open

Description

@applause-bot

If you haven’t already, check out our contributing guidelines for onboarding. To join our Slack channel, fill out this form.


Version Number: v9.5.0-0
Reproducible in staging?: Yes
Reproducible in production?: Yes
If this was caught during regression testing, add the test name, ID and link from BrowserStack: https://test-management.browserstack.com/projects/2219752/folder/53678307/test-cases/94420076
Email or phone of affected tester (no customers): nchandekar@applausemail.com
Issue reported by: Applause Internal Team
Bug source: Regression TC Execution
Device used: iOS , Windows 11, Android
App Component: Other

Action Performed:

Preconditions
1.Sign into NewDot as a domain admin. (use admin@expplause.com account)
2.Add a new member to test this scenario and don't lock any existing members

Steps:

  1. Navigate to Workspace > Domains [Your Domain] > Domain Members and click on a member row
  2. Click Report suspicious activity
  3. Review the warning message and Verify it states: "Are you sure? This will lock [email]'s account..."
  4. Click the red Report suspicious activity button at the bottom
  5. Click Lock account to confirm
  6. Click Unlock account
  7. Click Got it

Expected Result:

The modal closes and the UI reflects that the unlock request has been submitted

Actual Result:

UI does not reflect that the unlock request was submitted.

Workaround:

Unknown

Platforms:

  • Android: App
  • Android: mWeb Chrome
  • iOS: App
  • iOS: mWeb Safari
  • iOS: mWeb Chrome
  • Windows: Chrome
  • MacOS: Chrome Safari

Screenshots/Videos

Bug7272332_1790838590433.Repro_on_Android.mp4

View all open jobs on GitHub

Applause Internal Information
Exported by: Julia Ponikarchuk
Bug ID: 7272332

Upwork Automation - Do Not Edit
Issue OwnerCurrent Issue Owner: @getusha

Activity

  1. added
    Daily
    Bug
    on Oct 1, 2026
  2. MelvinBot commented on Oct 1, 2026

    @MelvinBot
    Contributor

    Proposal

    Please re-state the problem that we are trying to solve in this issue.

    A domain admin taps Unlock account for a locked member and then taps Got it. After that, the member details page looks the same as before. Nothing shows that the unlock request was sent.

    What is the root cause of that problem?

    The App sends the request, but it never records it. The UI has no "unlock requested" state to show.

    • showUnlockAccountModal calls requestUnlockAccount(accountID), then opens a modal that only gives information. Got it just closes the modal.
    • requestUnlockAccount makes a plain API.write call with no optimistic, success, or failure Onyx data, so Onyx doesn't change.
    • The page decides what to show from one true/false lock flag. That flag stays true until the security review finishes, so the Unlock account row stays the same. The admin can also tap it again and send duplicate requests.
    Code references

    This matches the original design. [Release 3.3] [Domain Control] Report suspicious activity only tested "Click Unlock account → Dismiss modal". [Test cases] Domain Control - Release 3 expects only "The modal closes. The unlock request is submitted." The wording "UI reflects that the unlock request has been submitted" appears only in the BrowserStack test case.

    What changes do you think we should make in order to solve the problem?

    First, product should decide whether a visible "Unlock requested" state is wanted. If it is not, this is expected behavior. Then we should update BrowserStack test case 94420076, step 13, to "modal closes" and close this issue.

    If product wants the state, follow the pattern already used to unlock bank accounts (BankAccounts.ts:1767-1786):

    1. Backend (outside App): store an "unlock requested" marker for the member and return it with the domain data. The App can't make this state survive a reload or show on other devices without it. An internal engineer would need to handle this part.
    2. App, requestUnlockAccount: set that marker in optimisticData. Add failureData that rolls it back and shows an error. Send domainAccountID and domainName too, the same way lockAccount does.
    3. App, DomainMemberDetailsPage: when the marker is set, show "Unlock requested" help text on the row. If the admin taps the row again, reopen the info modal but don't call the API again.
    4. Add the new copy to all src/languages/* files.

    What alternative solutions did you explore? (Optional)

    App-only local flag: set a flag that exists only on the client, with no backend change. The flag would disappear after a reload and wouldn't show on other devices, so I don't recommend relying on it alone.


    Next Steps for Contributor+ team:
    To accept: @MelvinBot implement [this](https://github.com/Expensify/App/issues/102734) to create a draft PR.
    To refine: @MelvinBot <your feedback>
    To reject: Explain why you are rejecting Melvin's proposal.


    view run

  3. added
    External
    on Oct 1, 2026
  4. melvin-bot commented on Oct 1, 2026

    @melvin-bot

    Triggered auto assignment to Contributor-plus team member for initial proposal review - @thesahindia (External)

  5. changed the title [-]Member Security - UI does not reflect that the unlock request was submitted.[/-] [+][$175] Member Security - UI does not reflect that the unlock request was submitted.[/+] on Oct 1, 2026
  6. melvin-bot commented on Oct 1, 2026

    @melvin-bot
  7. camesenin commented on Oct 1, 2026

    @camesenin
  8. bonnhatnguyen commented on Oct 1, 2026

    @bonnhatnguyen

    Proposal for Issue #102734: [$175] Member Security - UI does not reflect that the unlock request was submitted.

    Contributor Details

    • Contributor: @bonnhatnguyen
    • Email: bonnhatnguyen0@gmail.com
    • Upwork: https://www.upwork.com/freelancers/~0139ed4098bdc50182

    Proposal

    Please re-state the problem that we are trying to solve in this issue.

    When a domain admin clicks Unlock account for a locked domain member in Workspace > Domains > [Domain] > Domain Members > [Member] and closes the confirmation modal by clicking Got it, the UI does not indicate that the unlock request was submitted. The Unlock account button remains unchanged and interactive, allowing the admin to repeatedly trigger duplicate unlock API requests.


    What is the root cause of that problem?

    1. In src/libs/actions/User.ts, requestUnlockAccount(accountID) only sends accountID via API.write(WRITE_COMMANDS.REQUEST_UNLOCK_ACCOUNT, params) with no optimisticData, successData, or failureData. It also omits domainAccountID and domainName, which are defined in LockAccountParams:
      function requestUnlockAccount(accountID: number) {
          const params: LockAccountParams = {
              accountID,
          };
      
          API.write(WRITE_COMMANDS.REQUEST_UNLOCK_ACCOUNT, params);
      }
    2. In src/pages/domain/Members/DomainMemberDetailsPage.tsx, showUnlockAccountModal unconditionally executes requestUnlockAccount(accountID) immediately on tap before showing the informational modal:
      const showUnlockAccountModal = () => {
          requestUnlockAccount(accountID);
          showConfirmModal({
              title: translate('lockAccountPage.unlockTitle'),
              prompt: translate('lockAccountPage.unlockDescription'),
              confirmText: translate('common.buttonConfirm'),
              shouldShowCancelButton: false,
          });
      };
    3. The UnlockAccount menu item is not wrapped in OfflineWithFeedback, does not track any pendingAction (unlike other member actions like changeDomainSecurityGroup), and does not provide any visual indication (e.g. description/helpText or pending status) indicating that an unlock request has been submitted. Because unlocking an account involves external security/risk review, isAccountLocked remains true, leaving the button visually active and re-triggerable.

    (Note on context: In the original PR #78372 [Domain Control] Report suspicious activity, the flow was designed to acknowledge the action via the modal We’ve received your request. However, BrowserStack TC 94420076 explicitly expects the page UI itself to reflect the submitted state).


    What changes do you think we should make in order to solve the problem?

    1. Update requestUnlockAccount in src/libs/actions/User.ts:

    Update the signature to accept (accountID: number, domainAccountID?: number, domainName?: string) and provide optimistic, failure, and error-clearing data:

    function requestUnlockAccount(accountID: number, domainAccountID?: number, domainName?: string) {
        const params: LockAccountParams = {
            accountID,
            domainAccountID,
            domainName,
        };
    
        let domainOptimisticData: DomainOnyxUpdate[] = [];
        let domainFailureData: DomainOnyxUpdate[] = [];
        if (domainAccountID) {
            domainOptimisticData = [
                {
                    onyxMethod: Onyx.METHOD.MERGE,
                    key: `${ONYXKEYS.COLLECTION.DOMAIN_PENDING_ACTIONS}${domainAccountID}`,
                    value: {
                        member: {
                            [accountID]: {
                                unlockAccount: CONST.RED_BRICK_ROAD_PENDING_ACTION.UPDATE,
                            },
                        },
                    },
                },
                {
                    onyxMethod: Onyx.METHOD.MERGE,
                    key: `${ONYXKEYS.COLLECTION.DOMAIN_ERRORS}${domainAccountID}`,
                    value: {
                        memberErrors: {
                            [accountID]: {
                                unlockAccountErrors: null,
                            },
                        },
                    },
                },
            ];
    
            domainFailureData = [
                {
                    onyxMethod: Onyx.METHOD.MERGE,
                    key: `${ONYXKEYS.COLLECTION.DOMAIN_PENDING_ACTIONS}${domainAccountID}`,
                    value: {
                        member: {
                            [accountID]: {
                                unlockAccount: null,
                            },
                        },
                    },
                },
                {
                    onyxMethod: Onyx.METHOD.MERGE,
                    key: `${ONYXKEYS.COLLECTION.DOMAIN_ERRORS}${domainAccountID}`,
                    value: {
                        memberErrors: {
                            [accountID]: {
                                unlockAccountErrors: ErrorUtils.getMicroSecondOnyxErrorWithTranslationKey('lockAccountPage.failedToUnlockAccount'),
                            },
                        },
                    },
                },
            ];
        }
    
        API.write(WRITE_COMMANDS.REQUEST_UNLOCK_ACCOUNT, params, {
            optimisticData: domainOptimisticData,
            failureData: domainFailureData,
        });
    }

    2. Add clearUnlockAccountError in src/libs/actions/User.ts (and export it):

    function clearUnlockAccountError(domainAccountID: number, accountID: number) {
        Onyx.merge(`${ONYXKEYS.COLLECTION.DOMAIN_ERRORS}${domainAccountID}`, {
            memberErrors: {
                [accountID]: {
                    unlockAccountErrors: null,
                },
            },
        });
    }

    3. Update DomainMemberDetailsPage.tsx:

    • Pass domainAccountID and domainName to requestUnlockAccount.
    • Prevent duplicate API writes if unlockAccount pending action is already active. If already submitted, simply show the informational showConfirmModal:
    const isUnlockPending = domainPendingActions?.member?.[accountID]?.unlockAccount === CONST.RED_BRICK_ROAD_PENDING_ACTION.UPDATE;
    const unlockAccountErrors = getLatestError(domainErrors?.memberErrors?.[accountID]?.unlockAccountErrors);
    
    const showUnlockAccountModal = () => {
        if (!isUnlockPending) {
            requestUnlockAccount(accountID, domainAccountID, domainName);
        }
        showConfirmModal({
            title: translate('lockAccountPage.unlockTitle'),
            prompt: translate('lockAccountPage.unlockDescription'),
            confirmText: translate('common.buttonConfirm'),
            shouldShowCancelButton: false,
        });
    };
    • Wrap UnlockAccount in OfflineWithFeedback and render appropriate help/subtitle text indicating pending submission:
    {isAccountLocked ? (
        <OfflineWithFeedback
            pendingAction={domainPendingActions?.member?.[accountID]?.unlockAccount}
            errors={unlockAccountErrors}
            onClose={() => clearUnlockAccountError(domainAccountID, accountID)}
        >
            <MenuItemAction
                key="UnlockAccount"
                title={translate('lockAccountPage.unlockAccount')}
                description={isUnlockPending ? translate('lockAccountPage.unlockRequested') : undefined}
                icon={icons.Unlock}
                onPress={showUnlockAccountModal}
            />
        </OfflineWithFeedback>
    ) : (

    4. Add translation keys:

    In src/languages/en.ts (and other locale files):

    lockAccountPage: {
        ...
        unlockRequested: 'Unlock requested',
        failedToUnlockAccount: 'Failed to submit unlock request. Please try again or contact Concierge.',
    }

    What alternative solutions did you explore? (Optional)

    Product / QA specification review (NAB alternative):
    If Product confirms that the confirmation modal (We’ve received your request) was intentionally designed as the sole confirmation feedback (matching the original PR #78372 and test cases issue #84809), then BrowserStack TC 94420076 (Step 13: "The modal closes and the UI reflects that the unlock request has been submitted") should be updated to "The modal closes", and this issue closed as Expected Behavior.

  9. camesenin commented on Oct 1, 2026

    @camesenin
  10. camesenin commented on Oct 1, 2026

    @camesenin
  11. camesenin commented on Oct 1, 2026

    @camesenin
  12. 31 remaining items

  13. melvin-bot commented on Nov 13, 2026

    @melvin-bot

    Triggered auto assignment to Contributor-plus team member for initial proposal review - @eh2077 (External)

  14. added
    Daily
    and removed
    Weekly
    on Nov 13, 2026
  15. mallenexpensify commented on Nov 13, 2026

    @mallenexpensify
    Contributor

    Claude posting on behalf of Matt:

    @eh2077 please take over as C+. Please review the status of PR #104188: #104188

  16. eh2077 commented on Nov 16, 2026

    @eh2077
    Contributor

    I don't have self owned domain email to test this issue, so asked in slack and @getusha will take over!

  17. assigned and unassigned on Nov 16, 2026
  18. melvin-bot commented on Nov 16, 2026

    @melvin-bot

    📣 @getusha 🎉 An offer has been automatically sent to your Upwork account for the Contributor role 🎉 Thanks for contributing to the Expensify app!

    Offer link
    Upwork job
    Please accept the offer and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review 🧑‍💻
    Keep in mind: Code of Conduct | Contributing 📖

  19. eh2077 commented on Nov 16, 2026

    @eh2077
    Contributor

    @mallenexpensify hmm, I tried to unassign myself and assign it to another C+, but Melvin sent an offer to them. It doesn't seem right, wdyt?

  20. getusha commented on Nov 16, 2026

    @getusha
    Contributor

    @MelvinBot implement this

  21. MelvinBot commented on Nov 16, 2026

    @MelvinBot
    Contributor

    🤖 Web test steps verification results: ⚠️ partial

    All six assertions were blocked: the session was suspended and browser snapshots returned no UI nodes. No accounts were locked or modified.

    Browser state when verification was blocked

    Step Status
    Report suspicious activity for a new test memberBlocked: app UI inaccessible.
    Browser state when verification was blocked
    ⚠️
    Confirm Lock accountBlocked; no lock attempted.
    ⚠️
    Unlock → Got it shows pending label and hourglassBlocked before reaching a locked test member.
    ⚠️
    Reopening pending confirmation sends no duplicate requestBlocked; pending state could not be established.
    ⚠️
    Offline unlock shows alert without queuingBlocked by inaccessible UI.
    ⚠️
    Failed unlock shows dismissible error and allows retryBlocked by inaccessible UI.
    ⚠️

    Implemented in draft PR: Show pending domain member unlock requests and block offline submission, assigned to getusha.

    Checks: 335 targeted tests pass, plus lint, typecheck, spelling, formatting, changed-page React Compiler check, and Storybook smoke test. Full Jest timed out; translation dry-run was blocked. Pending state remains local-only as agreed. Manual browser verification is still required before marking ready for review.


    view run · no recording available

  22. expensify-chore-bot commented on Nov 23, 2026

    @expensify-chore-bot

    @getusha Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

  23. expensify-chore-bot commented on Nov 25, 2026

    @expensify-chore-bot

    @getusha Eep! 4 days overdue now. Issues have feelings too...

  24. added
    Weekly
    and removed
    Daily
    on Nov 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

BugDesignExternalReviewingWeekly

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions