Skip to content

[Due for payment 2026-06-24] [Due for payment 2026-06-23] Workflow - Invited phone number appears twice in Expenses from list #93621

Closed

Description

@applause-bot

If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!


Version Number: 9.4.8-0
Reproducible in staging?: Yes
Reproducible in production?: N/A - new feature, doesn't exist in prod
If this was caught during regression testing, add the test name, ID and link from BrowserStack: #80449
Email or phone of affected tester (no customers): jnosdjosjdoijson@gmail.com
Issue reported by: Applause Internal Team
Bug source: Exploratory - Significant User Experience Deterioration
Device used: Mac 26.5 / Chrome
App Component: Workspace Settings

Action Performed:

  1. Go to staging.new.expensify.com
  2. Go to workspace settings > Workflows.
  3. Click Add approval workflow.
  4. Upgrade workspace if needed.
  5. Enter phone number which does not have ND account > select it > Next.
  6. Click Invite.
  7. Select any approver > Skip.
  8. On confirm page, click Expenses from.
  9. Click RHP back button.

Expected Result:

In Step 8, the invited phone number will appear once in the list.
In Step 9, after user clicks RHP back button, the phone number will remain selected.

Actual Result:

In Step 8, the invited phone number appears twice in the list.
In Step 9, after user clicks RHP back button, the phone number is no longer selected.

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Bug7181526_1781548565638.2.mp4

View all open jobs on GitHub

Applause Internal Information
Exported by: Nathan Lemma
Bug ID: 7181526

Issue OwnerCurrent Issue Owner: @hoangzinh

Activity

  1. applause-bot commented on Jun 15, 2026

    @applause-bot
    Author

    While Applause doesn't embed attachments for this bug, here are the links for quick view:
    https://platform.applause.com/services/links/v1/external/c02dec6024cb05e741880df7f4db5a96dc8b7ea498197a07e119d9cc975e9d5c

  2. added
    DeployBlockerCashThis issue or pull request should block deployment
    BugSomething is broken. Auto assigns a BugZero manager.
    on Jun 15, 2026
  3. melvin-bot commented on Jun 15, 2026

    @melvin-bot

    You have been assigned to this deploy blocker because you recently merged this PR: #80449

  4. melvin-bot commented on Jun 15, 2026

    @melvin-bot

    💬 A slack conversation has been started in #expensify-open-source

  5. github-actions commented on Jun 15, 2026

    @github-actions
    Contributor

    👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:

    1. Identify the pull request that introduced this issue and revert it.
    2. Find someone who can quickly fix the issue.
    3. Fix the issue yourself.
  6. MelvinBot commented on Jun 15, 2026

    @MelvinBot
    Contributor

    Proposal

    🤖 Generated by MelvinBot — high confidence. Both reported symptoms (duplicate row + lost selection) trace to a single root cause, verified with file:line evidence.

    What is the root cause of that problem?

    A phone-number email-key mismatch introduced in PR #80449.

    When you invite by phone number, the same person ends up stored under two different key formats:

    +15551234567 ≠ +15551234567@expensify.sms, so every lookup that bridges these two stores fails:

    • Duplicate row: the dedup filter in allApprovers compares the selected member's login (+1555…) against the live policy member's login (+1555…@expensify.sms). No match → the invitee is rendered once as the selected entry and again as the policy member. (WorkspaceWorkflowsApprovalsExpensesFromPage.tsx:210-212)
    • Lost selection on back: goBack keeps only members found in employeeList via policy?.employeeList?.[m.email]. m.email is +1555…, the key is +1555…@expensify.sms → undefined → the just-invited member is treated as "never invited" and dropped. (WorkspaceWorkflowsApprovalsExpensesFromPage.tsx:280-284). The selection-sync effect has the same broken lookup at lines 117-122.

    A plain email invite works because its key is identical in both stores — only phone numbers get the @expensify.sms suffix, which is exactly why this bug is phone-number specific.

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

    Normalize the invitee login to the SMS-domain form at the one boundary where the page writes it — so all three stores (approvalWorkflow.members, the invite draft, and the eventual employeeList) agree.

    In WorkspaceWorkflowsApprovalsExpensesFromPage.tsx, apply PhoneNumber.addSMSDomainIfPhoneNumber(member.login) when building email/draft keys in toggleMember and nextStep (the same helper the invite action uses). This makes approvalWorkflow.members[].email and the draft keys match the employeeList key that addMembersToWorkspace will produce, fixing both the dedup filter and the goBack/sync employeeList lookups in one place.

    Alternative & verification notes

    Alternative: wrap each of the ~5 employeeList lookups (lines 117, 121, 211, 281, 315, 435) in addSMSDomainIfPhoneNumber(...). Works but is more error-prone (easy to miss a site, and the comparison must be applied on both sides consistently). The single normalization point at the write boundary is cleaner.

    Verified: addSMSDomainIfPhoneNumber appends CONST.SMS.DOMAIN (@expensify.sms) to valid E.164 phone numbers and is a no-op for emails (PhoneNumber.ts:63), so applying it uniformly is safe for both email and phone invitees.

    Suggested regression test: the phone-number flow from the issue (invite phone number → complete → return to Expenses from → back), asserting the invitee appears exactly once and stays selected. PR #80449 added unit tests only to PolicyUtilsTest.ts; none cover this phone-number round-trip.


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

  7. melvin-bot commented on Jun 15, 2026

    @melvin-bot

    ⚠️ Looks like this issue was linked to a Deploy Blocker here

    If you are the assigned CME please investigate whether the linked PR caused a regression and leave a comment with the results.

    If a regression has occurred and you are the assigned CM follow the instructions here.

    If this regression could have been avoided please consider also proposing a recommendation to the PR checklist so that we can avoid it in the future.

  8. youssef-lr commented on Jun 15, 2026

    @youssef-lr
    Contributor

    @MelvinBot implement this

  9. MelvinBot commented on Jun 15, 2026

    @MelvinBot
    Contributor

    🤖 Draft PR created: #93640
    Please mark it as "Ready for review" when it is ready for review.

  10. 6 remaining items

  11. IuliiaHerets commented on Jun 16, 2026

    @IuliiaHerets

    Chrome / v9.4.8-2
    Passed

    REC-20260616185508.mp4
  12. puneetlath commented on Jun 16, 2026

    @puneetlath
    Contributor

    Nice!

  13. changed the title [-]Workflow - Invited phone number appears twice in Expenses from list[/-] [+][Due for payment 2026-06-23] Workflow - Invited phone number appears twice in Expenses from list[/+] on Jun 16, 2026
  14. melvin-bot commented on Jun 16, 2026

    @melvin-bot

    Reviewing label has been removed, please complete the "BugZero Checklist".

  15. melvin-bot commented on Jun 16, 2026

    @melvin-bot

    The solution for this issue has been 🚀 deployed to production 🚀 in version 9.4.8-3 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:

    If no regressions arise, payment will be issued on 2026-06-23. 🎊

    For reference, here are some details about the assignees on this issue:

    • @hoangzinh requires payment through NewDot Manual Requests
  16. melvin-bot commented on Jun 16, 2026

    @melvin-bot

    @hoangzinh The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]. If no checklist is needed for this issue, you can click: [no checklist button]

  17. changed the title [-][Due for payment 2026-06-23] Workflow - Invited phone number appears twice in Expenses from list[/-] [+][Due for payment 2026-06-24] [Due for payment 2026-06-23] Workflow - Invited phone number appears twice in Expenses from list[/+] on Jun 17, 2026
  18. melvin-bot commented on Jun 17, 2026

    @melvin-bot

    The solution for this issue has been 🚀 deployed to production 🚀 in version 9.4.9-0 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:

    If no regressions arise, payment will be issued on 2026-06-24. 🎊

    For reference, here are some details about the assignees on this issue:

    • @hoangzinh requires payment through NewDot Manual Requests
  19. melvin-bot commented on Jun 17, 2026

    @melvin-bot

    @hoangzinh The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]. If no checklist is needed for this issue, you can click: [no checklist button]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

BugSomething is broken. Auto assigns a BugZero manager.DailyKSv2Engineering

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions