Skip to content

[Ready for payment][$250] Account - Page not found when user re-added second contact after removal #75277

Closed

Description

@jponikarchuk

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: v9.2.59-1
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/13176687/test-cases/41236654
Email or phone of affected tester (no customers): NA
Issue reported by: Applause Internal Team
Device used: iphone promax 13, IOS 26.1
App Component: Workspace Settings

Action Performed:

  1. Launch hybrid app (IOS)
  2. User logged in
  3. Navigate to Profile >> Contact Methods
  4. Tap "New Contact Method" >> Enter an email >> Tap "Add"
  5. Enter magic code >> Tap "Verify"
  6. Enter magic code >> Tap "Verify"
  7. Tap on the just added 2nd contact method >> Select "Remove" >> Select "Yes, Continue" ( secondary contact method is removed from the list)
  8. Repeat step 4 (enter the same email address)

Expected Result:

Magic code page is displayed and user able to continue verify email till complete the process of add 2nd contact

Actual Result:

After user tap "Add", the magic code page briefly displayed then "Hmm.. it's not here" appeared.
Note: the issue occurred on ios, not on Web and web

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

1.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021993522678012879486
  • Upwork Job ID: 1993522678012879486
  • Last Price Increase: 2025-12-10
  • Automatic offers:
    • situchan | Reviewer | 109787163
Issue OwnerCurrent Issue Owner: @
Issue OwnerCurrent Issue Owner: @strepanier03

Activity

  1. added
    Daily
    Bug
    on Nov 17, 2025
  2. melvin-bot commented on Nov 17, 2025

    @melvin-bot

    Triggered auto assignment to @strepanier03 (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.

  3. added
    Needs Reproduction
    on Nov 17, 2025
  4. strepanier03 commented on Nov 17, 2025

    @strepanier03
    Contributor

    Setting to Needs Repro because I can't test iOS: App.

  5. MelvinBot commented on Nov 18, 2025

    @MelvinBot
    Contributor

    This has been labelled "Needs Reproduction". Follow the steps here: https://stackoverflowteams.com/c/expensify/questions/16989

  6. situchan commented on Nov 18, 2025

    @situchan
    Contributor

    I reproduced following step in OP.

    Screen.Recording.2025-11-18.at.9.06.19.AM.mov

    I can take this as C+

  7. added
    External
    and removed
    Needs Reproduction
    on Nov 26, 2025
  8. melvin-bot commented on Nov 26, 2025

    @melvin-bot
  9. changed the title [-]Account - Page not found when user re-added second contact after removal[/-] [+][$250] Account - Page not found when user re-added second contact after removal[/+] on Nov 26, 2025
  10. 42 remaining items

  11. added
    Weekly
    and removed
    Daily
    on Dec 12, 2025
  12. TaduJR commented on Dec 13, 2025

    @TaduJR
    Contributor

    Update: Unfortunately the alternative solution two is not working reliably across platforms like iOS App, but works on Web, and Android.

    Why the fix should be in addPendingContactMethod, not clearUnvalidatedNewContactMethodAction

    I tested both approaches with detailed logging. The logs show that Onyx.set(null) in clearUnvalidatedNewContactMethodAction doesn't fix the bug because the cache gets repopulated with stale data before addPendingContactMethod is called.

    Evidence from logs

    When addPendingContactMethod is called, the cache already contains stale data:

    existingValue (from cache): {
      "contactMethod": null,
      "validateCodeSent": null,
      "actionVerified": true,        // ← STALE! Should not exist
      "errorFields": {"actionVerified": null}
    }

    Why this happens

    1. Onyx.set(null) clears the cache synchronously ✓
    2. But the cache gets repopulated from a pending merge (the previous verification's successData that set actionVerified: true)
    3. When Onyx.merge({contactMethod}) runs, it preserves the stale actionVerified: true

    clearUnvalidatedNewContactMethodAction fix doesn't work

    Both Onyx.set(null) and Onyx.merge(null) call the same internal OnyxUtils.remove() function:

      // Both end up here:
      function remove(key) {
          OnyxCache.drop(key);                    // 1. Clear cache (sync)
          scheduleSubscriberUpdate(key, undefined); // 2. Notify subscribers
          return Storage.removeItem(key);          // 3. DB removal (async)
      }

    The cache is cleared, but pending Onyx operations in the merge queue can repopulate it before addPendingContactMethod is called. Changing clearUnvalidatedNewContactMethodAction to use Onyx.set(null) doesn't prevent this repopulation.

    But Onyx.set in addPendingContactMethod fixes it

    Using Onyx.set({contactMethod}) instead of Onyx.merge({contactMethod}) completely replaces the value, ignoring any stale data in cache. This ensures a clean state regardless of what's in cache or DB.

  13. added
    Weekly
    and removed
    Weekly
    on Dec 13, 2025
  14. TaduJR commented on Dec 13, 2025

    @TaduJR
    Contributor

    PR is ready!

  15. Julesssss commented on Dec 22, 2025

    @Julesssss
    Contributor

    PR merged

  16. TaduJR commented on Jan 14, 2026

    @TaduJR
    Contributor

    I think this is ready for payment.

    Production deployed 3 weeks ago.

  17. changed the title [-][$250] Account - Page not found when user re-added second contact after removal[/-] [+][Ready for payment][$250] Account - Page not found when user re-added second contact after removal[/+] on Jan 14, 2026
  18. Julesssss commented on Jan 14, 2026

    @Julesssss
    Contributor

    Ah yes, not sure what happened here.

    @strepanier03 could you please pay the contributors, the automation must have failed somehow.

  19. strepanier03 commented on Jan 27, 2026

    @strepanier03
    Contributor

    Thanks for the bump @TaduJR - Ownership was still set to someone else so this wasn't appearing in my K2, I just switched it over. I'll handle today.

  20. strepanier03 commented on Jan 27, 2026

    @strepanier03
    Contributor

    Payment summary

    For: #77507

  21. situchan commented on Jan 27, 2026

    @situchan
    Contributor

    @situchan I already accepted this automatic offer

  22. strepanier03 commented on Jan 27, 2026

    @strepanier03
    Contributor

    Thanks @situchan - Upwork wasn't showing me an active contract so I created the new one. I paid the original and then withdrew the new offer.

    @TaduJR - Upwork is on the fritz, it showed me two offers sent to you when I only sent you one. I paid one of the offers and canceled the other.

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

Metadata

Metadata

Labels

BugExternalReviewingWeekly

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions