Skip to content

[Due for payment 2026-07-13] Rules - Currency mismatch modal flickers #94116

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.16-1
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: #93063
Email or phone of affected tester (no customers): applausetester+bm889072@applause.expensifail.com
Issue reported by: Applause Internal Team
Bug source: Exploratory - Significant User Experience Deterioration
Device used: android
App Component: Workspace Settings

Action Performed:

  1. Go to https://staging.new.expensify.com/
  2. Enable expensify cards & rules
  3. Go to Rules
  4. Add Spend Rules > Click on Permitted Currencies (might need to click a few times)

Expected Result:

The currency mismatch modal should open smoothly without flickering.

Actual Result:

The currency mismatch modal flickers.

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Bug7185726_1781893009256.1.mp4

View all open jobs on GitHub

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

Activity

  1. applause-bot commented on Jun 20, 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/021ee6cc44cefc470ba27c3e99647efc9393e19ce81130a61f45d36219e708c8

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

    @melvin-bot

    @luacmartins recently merged #93063, but they are OOO right now, so I'll auto-assign someone else.

  4. melvin-bot commented on Jun 20, 2026

    @melvin-bot

    Triggered auto assignment to @NikkiWines (DeployBlockerCash), see https://stackoverflowteams.com/c/expensify/questions/9980/ for more details.

  5. melvin-bot commented on Jun 20, 2026

    @melvin-bot

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

  6. github-actions commented on Jun 20, 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.
  7. MelvinBot commented on Jun 20, 2026

    @MelvinBot
    Contributor

    Proposal

    What is the root cause of that problem?

    The "currency mismatch" modal is the global confirm modal opened by openCurrenciesCurrencyMismatchModal, triggered from the Permitted Currencies menu item via chooseCurrencies when no shared settlement currency is found (e.g. no cards selected yet).

    The flicker is a modal remount on repeated taps, which is exactly why the repro note says "might need to click a few times":

    1. The Permitted Currencies row is a MenuItemWithTopDescription with a plain onPress={chooseCurrencies} and no singleExecution/throttle — onPress fires on every tap.
    2. showConfirmModal is called without an id, so each tap pushes a brand-new modal onto the global stack with a fresh incrementing id (modalID = id ?? String(modalIDRef.current++)).
    3. The provider renders only the top modal, keyed by that id: key={modalToRender.id}. A second tap changes the key, so React unmounts the in-flight ConfirmModalWrapper and mounts a new one, re-running the entrance animation while the previous one is torn down → visible flicker (most noticeable on Android).

    A single tap keeps the key stable ("1") and animates in smoothly; multiple taps are what produce the flicker. This is a regression introduced by #93063 (new feature). The same pattern also affects openMaxAmountCurrencyMismatchModal.

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

    Pass a stable id to showConfirmModal for both currency-mismatch modals. The global modal system is designed to dedupe by id: when an id is supplied, showModal updates the existing modal in place instead of appending a new one, so the React key stays constant and the modal no longer remounts/flickers on repeated taps.

    • Give openCurrenciesCurrencyMismatchModal a constant id (e.g. id: 'spendRuleCurrenciesCurrencyMismatch') and openMaxAmountCurrencyMismatchModal its own (e.g. id: 'spendRuleMaxAmountCurrencyMismatch').

    What alternative solutions did you explore? (Optional)

    • Guard re-entry by passing singleExecution/debouncing the menu item's onPress (or early-returning while a modal is already open). This also stops the flicker but the id approach is the system's intended dedup mechanism and is more localized.
    Confidence & verification

    Medium–High. The full chain is traced in code (no tap throttle → no id → incrementing modal id → keyed remount). Not yet runtime-verified that react-native-modal visibly re-animates on remount on Android, but the "click a few times" repro corroborates the remount mechanism. Worth a quick on-device confirmation after the fix.


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

  8. Dip-G-Git commented on Jun 21, 2026

    @Dip-G-Git
  9. melvin-bot commented on Jun 21, 2026

    @melvin-bot
  10. NikkiWines commented on Jun 22, 2026

    @NikkiWines
    Contributor

    @JS00001 looks like #93063 introduced this issue. Could you please take a look 🙇 cc: @marufsharifi @luacmartins as you both approved

  11. 12 remaining items

  12. melvin-bot commented on Jun 22, 2026

    @melvin-bot

    The solution for this issue has been 🚀 deployed to production 🚀 in version 9.4.16-5 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-29. 🎊

  13. melvin-bot commented on Jun 22, 2026

    @melvin-bot

    @JS00001 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]

  14. changed the title [-][Due for payment 2026-06-29] Rules - Currency mismatch modal flickers[/-] [+][Due for payment 2026-06-30] [Due for payment 2026-06-29] Rules - Currency mismatch modal flickers[/+] on Jun 23, 2026
  15. melvin-bot commented on Jun 23, 2026

    @melvin-bot

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

  16. melvin-bot commented on Jun 23, 2026

    @melvin-bot

    The solution for this issue has been 🚀 deployed to production 🚀 in version 9.4.17-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-30. 🎊

  17. melvin-bot commented on Jun 23, 2026

    @melvin-bot

    @JS00001 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]

  18. changed the title [-][Due for payment 2026-06-30] [Due for payment 2026-06-29] Rules - Currency mismatch modal flickers[/-] [+][Due for payment 2026-07-13] Rules - Currency mismatch modal flickers[/+] on Jul 6, 2026
  19. melvin-bot commented on Jul 6, 2026

    @melvin-bot

    The solution for this issue has been 🚀 deployed to production 🚀 in version 9.4.27-2 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-07-13. 🎊

  20. melvin-bot commented on Jul 6, 2026

    @melvin-bot

    @JS00001 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

Assignees

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