Skip to content

Prevent resubmitting an international bank account after success - #106752

Merged
Julesssss merged 3 commits into
mainfrom
claude-internationalBankSuccessBack
Nov 16, 2026
Merged

Julesssss merged 3 commits into
mainfrom
claude-internationalBankSuccessBack

Conversation

@MelvinBot

@MelvinBot MelvinBot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

Explanation of Change

Prevent returning from international bank-account success to a confirmation that can submit the same account again. This follows situchan's alternative solution, preserving normal step history rather than replacing every wizard route:

  • Android Back on success uses the existing finish/cleanup path.
  • Confirmation remembers advancing after successful creation and uses previous focus to finish when it regains focus, including when it blurred before creation succeeded.
  • Successful wallet-flow creation clears the international draft through API success updates; pending and failed requests retain it for retry.
  • Unfinished steps and edit returns retain their current navigation behavior.

Scope is the reported Wallet flow. The pre-existing finish fallback for entry points outside Settings/Inbox without backTo is unchanged; as noted in the alternative solution, that fallback can still pop a step rather than close the entire flow.

Per situchan's scoped follow-up, history is intentionally unchanged. This does not remove completed Confirmation from browser history or address the reported transition flash.

AI Tests

  • Draft/focus follow-up (b23fe0f2): all 22 targeted tests passed, including successful draft removal, pending/failure draft retention, and blur-before-success focus cleanup. Full typecheck, full lint, file-targeted lint, formatter, file-targeted spelling, Storybook smoke, whitespace check, and AI coding-standards review passed.
  • Follow-up limitations: full Jest exceeded 180 seconds after reporting passing suites; it did not complete. lint-changed and spell-changed discovery failed because the shallow checkout lacked a merge base; direct changed-file checks passed. React Compiler check-changed exceeded 120 seconds; the direct file check exited successfully without output, so no completed compliance comparison is claimed. The legacy prettier script is absent; used the repository's Oxfmt formatter instead. Full-repository spelling reported pre-existing issues outside the changed files.
  • Web verification of this follow-up was blocked: the tester found a suspended session and a blank dev NewDot page with no accessible controls. No successful live submission, draft persistence, or focus behavior is claimed from browser testing.

Blank dev NewDot web page

  • Passed: 46 targeted Jest tests across the new completion-navigation component suite, international-bank validation, and shared subpage navigation. The new suite isolates focus/subpage boundaries; it is not an end-to-end API retry or browser-history test.
  • Passed: full npm run typecheck, changed-file lint (npm run lint-changed -- --shards=1), changed-file spelling, Storybook smoke test, and staged whitespace check.
  • Incomplete: full lint and full Jest were attempted but exceeded the 180-second limit; full Jest reported passing suites before timeout, not a complete run.
  • Incomplete: React Compiler check-changed exceeded 60 seconds. A direct file check exited successfully without output; no complete changed-versus-main compliance result is claimed.
  • CI-formatting follow-up: ran the repository's actual formatter (npm run fmt) and committed its test-only formatting correction. A second formatter run produced no unstaged diff. All 4 completion-navigation tests, file-targeted lint, Storybook smoke, staged whitespace, and AI coding-standards review passed. Full lint, full Jest, and typecheck exceeded 180-second local limits; lint-changed and spell-changed stalled fetching origin/main. The legacy prettier command is unavailable because this repository uses Oxfmt.
  • Manual browser/native verification remains pending. Created as a draft per the requester's manual-verification handoff; no successful live bank-account submission is claimed.

Fixed Issues

$ #102213
PROPOSAL: #102213 (comment)

Tests

  • Verify that no errors appear in the JS console

// TODO: The human co-author must fill out the tests you ran before marking this PR as "ready for review"
// Please describe what tests you performed that validates your changed worked.

Offline tests

QA Steps

  1. Go to Account > Wallet > Add bank account
  2. Select a non-US country and press Next
  3. Fill in every step with valid details
  4. On the confirmation page, tick the terms and press Confirm
  5. On the success page, press the browser Back button (device Back button on Android)
  6. Verify the flow closes and the Wallet page shows the new account
  7. Verify the confirmation page for that account does not open
  • Verify that no errors appear in the JS console

PR Author Checklist

  • I linked the correct issue in the ### Fixed Issues section above
  • I wrote clear testing steps that cover the changes made in this PR
    • I added steps for local testing in the Tests section
    • I added steps for the expected offline behavior in the Offline steps section
    • I added steps for Staging and/or Production testing in the QA steps section
    • I added steps to cover failure scenarios (i.e. verify an input displays the correct error message if the entered data is not correct)
    • I turned off my network connection and tested it while offline to ensure it matches the expected behavior (i.e. verify the default avatar icon is displayed if app is offline)
    • I tested this PR with a High Traffic account against the staging or production API to ensure there are no regressions (e.g. long loading states that impact usability).
  • I included screenshots or videos for tests on all platforms
  • I ran the tests on all platforms & verified they passed on:
    • Android: Native
    • Android: mWeb Chrome
    • iOS: Native
    • iOS: mWeb Safari
    • MacOS: Chrome / Safari
  • I verified there are no console errors (if there's a console error not related to the PR, report it or open an issue for it to be fixed)
  • I verified any copy / text that was added to the app is either coming verbatim from figma or has been approved by marketing (in order to get marketing approval, ask the Bug Zero team member to add the Waiting for copy label to the issue)
  • If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
  • I tested other components that can be impacted by my changes (i.e. if the PR modifies a shared library or component like Avatar, I verified the components using Avatar are working as expected)
  • If new assets were added or existing ones were modified, I verified that:
    • The assets are optimized and compressed (for SVG files, run npm run compress-svg)
    • The assets load correctly across all supported platforms.
  • If the PR modifies code that runs when editing or sending messages, I tested and verified there is no unexpected behavior for all supported markdown - URLs, single line code, code blocks, quotes, headings, bold, strikethrough, and italic.
  • If the PR modifies a generic component, I tested and verified that those changes do not break usages of that component in the rest of the App (i.e. if a shared library or component like Avatar is modified, I verified that Avatar is working as expected in all cases)
  • If the PR modifies a component related to any of the existing Storybook stories, I tested and verified all stories for that component are still working as expected.
  • If the PR modifies a component or page that can be accessed by a direct deeplink, I verified that the code functions as expected when the deeplink is used - from a logged in and logged out account.
  • If the PR modifies the UI (e.g. new buttons, new UI components, changing the padding/spacing/sizing, moving components, etc) or modifies the form input styles:
    • I verified that all the inputs inside a form are aligned with each other.
    • I added Design label and/or tagged @Expensify/design so the design team can review the changes.
  • If the PR adds or modifies the UI:
    • I asked an AI agent to review the changes for accessibility issues and addressed its findings.
    • I tested with a screen reader (VoiceOver on macOS) and verified all new/changed elements are reachable with a logical focus order.
    • I verified all new/changed elements have meaningful accessible names and roles.
    • I verified state changes are announced (e.g. checked/unchecked, expanded/collapsed, selected).
  • I added unit tests for any new feature or bug fix in this PR to help automatically prevent regressions in this user flow.
  • If the main branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to the Test steps.

Screenshots/Videos

Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari

Co-authored-by: Situ Chandra Shil <situchan@users.noreply.github.com>
@MelvinBot

MelvinBot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor Author

🤖 Web test steps verification results: ❌ fail

Blocked on dev NewDot web: Add bank account requires an emailed six-digit security code. No account was created; stopped without attempting to bypass verification.

Add bank account blocked by emailed security-code verification

Step Status
1. Open Account > Wallet > Add bank account with Wise reimbursements beta offReached Wallet and clicked Add bank account, but a “Validate your account” dialog appeared. Wise beta state could not be confirmed.
Add bank account blocked by emailed security-code verification
❌
2. Select United Kingdom and complete all detailsBlocked before country selection by account verification.
❌
3. Accept terms, Confirm, and verify genuine creationNot reached. No successful bank-account creation observed.
❌
4. Browser Back closes the flow and Wallet shows the new accountNot reached because account creation was blocked.
❌
5. Completed confirmation cannot resubmit the accountNot reached; no completed confirmation existed.
❌
6. Verify no JavaScript console errorsUnverified: the available browser-testing commands do not expose JavaScript console inspection.
❌

view run · no recording available

@codecov

codecov Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ Changes either increased or maintained existing code coverage, great job!

Files with missing lines Coverage Δ
src/libs/actions/BankAccounts.ts 50.59% <100.00%> (+1.48%) ⬆️
...ositAccount/InternationalDepositAccountContent.tsx 87.20% <100.00%> (+85.80%) ⬆️
... and 460 files with indirect coverage changes

Co-authored-by: Situ Chandra Shil <situchan@users.noreply.github.com>
@MelvinBot

Copy link
Copy Markdown
Contributor Author

Pushed 1707da3, correcting the Oxfmt failure with a formatting-only test change.

Passed locally: formatter, all 4 targeted tests, file-targeted lint, and Storybook smoke. Broader checks timed out; new CI results are pending.

The independent-approval failure requires human review, not a code fix.


view run

@MelvinBot

MelvinBot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor Author

🤖 Android test steps verification results: ❌ fail

Standalone Android NewDot testing was blocked by mandatory email security-code verification after selecting Add bank account. No bank account was created; Wise beta state and success-path behavior remain unverified.

Mandatory security-code verification blocks adding a bank account

Step Status
1. With Wise reimbursements beta off, navigate Account > Wallet > Add bank account.Reached Add bank account, but opening it required an unavailable six-digit email security code. Wise beta state was not confirmed.
Mandatory security-code verification blocks adding a bank account
❌
2. Select a non-US country and press Next.Blocked before country selection by security-code verification.
❌
3. Fill every step with valid details.Not reached because security-code verification blocked entry.
❌
4. Accept terms, press Confirm, and verify genuine successful creation.Confirmation was not reached; no account was created or success simulated.
❌
5. After success, Android Back closes the flow and Wallet shows the account.Success prerequisite was unavailable; Back behavior was not tested.
❌
6. Completed confirmation cannot be reopened or resubmitted.No completed confirmation existed, so duplicate-submission prevention remains unverified.
❌
7. Verify no JS console errors.Diagnostic logs were inaccessible; absence of JavaScript errors could not be established.
❌

view run · view recording

@MelvinBot

Copy link
Copy Markdown
Contributor Author

⚠️ Something went wrong. This may be a transient issue. Try again. If it persists, check status.openai.com.

Run details

@MelvinBot

Copy link
Copy Markdown
Contributor Author

⚠️ Something went wrong. This may be a transient issue. Try again. If it persists, check status.openai.com.

Run details

@situchan

Copy link
Copy Markdown
Contributor

@MelvinBot did you implement my alternative solution instead of your original proposal because my approach is better?

@MelvinBot

Copy link
Copy Markdown
Contributor Author

Yes—I implemented your alternative solution, rather than my original route-replacement proposal.

It is better scoped for this bug: it preserves unfinished-step history and edit navigation, whereas my proposal would also change browser Back during an unfinished flow.

The implementation uses your two mechanisms: finish on Android Back from success, and finish when a completed confirmation regains focus.

I should have explicitly explained that choice before implementing it. End-to-end verification remains blocked by email security-code verification.


view run

@situchan

Copy link
Copy Markdown
Contributor

@MelvinBot add QA steps and mark this PR ready for review

  1. Go to Account > Wallet > Add bank account
  2. Select a non-US country and press Next
  3. Fill in every step with valid details
  4. On the confirmation page, tick the terms and press Confirm
  5. On the success page, press the browser Back button (device Back button on android)
  6. Verify the flow closes and the Wallet page shows the new account
  7. Verify the confirmation page for that account does not open

@MelvinBot
MelvinBot marked this pull request as ready for review November 13, 2026 05:11
@MelvinBot
MelvinBot requested a review from a team as a code owner November 13, 2026 05:11
@melvin-bot
melvin-bot Bot requested review from situchan and removed request for a team November 13, 2026 05:11
@melvin-bot

melvin-bot Bot commented Nov 13, 2026

Copy link
Copy Markdown

@situchan Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button]

@MelvinBot

Copy link
Copy Markdown
Contributor Author

Added your seven QA steps and marked Prevent resubmitting an international bank account after success ready for review.


view run

@melvin-bot
melvin-bot Bot requested review from JmillsExpensify and removed request for a team November 13, 2026 05:11
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-13T05:31:24.275602Z 1707da3 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@situchan

Copy link
Copy Markdown
Contributor

Reviewer Checklist

  • I have verified the author checklist is complete (all boxes are checked off).
  • I verified the correct issue is linked in the ### Fixed Issues section above
  • I verified testing steps are clear and they cover the changes made in this PR
    • I verified the steps for local testing are in the Tests section
    • I verified the steps for Staging and/or Production testing are in the QA steps section
    • I verified the steps cover any possible failure scenarios (i.e. verify an input displays the correct error message if the entered data is not correct)
    • I turned off my network connection and tested it while offline to ensure it matches the expected behavior (i.e. verify the default avatar icon is displayed if app is offline)
  • I checked that screenshots or videos are included for tests on all platforms
  • I included screenshots or videos for tests on all platforms
  • I verified that the composer does not automatically focus or open the keyboard on mobile unless explicitly intended. This includes checking that returning the app from the background does not unexpectedly open the keyboard.
  • I verified tests pass on all platforms & I tested again on:
    • Android: HybridApp
    • Android: mWeb Chrome
    • iOS: HybridApp
    • iOS: mWeb Safari
    • MacOS: Chrome / Safari
  • If there are any errors in the console that are unrelated to this PR, I either fixed them (preferred) or linked to where I reported them in Slack
  • I verified any copy / text that was added to the app is either coming verbatim from figma or has been approved by marketing (in order to get marketing approval, ask the Bug Zero team member to add the Waiting for copy label to the issue)
  • If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
  • I verified other components that can be impacted by these changes have been tested, and I retested again (i.e. if the PR modifies a shared library or component like Avatar, I verified the components using Avatar have been tested & I retested again)
  • If a new component is created I verified that:
    • A similar component doesn't exist in the codebase
    • All props are defined accurately
    • The component has a clear name that is non-ambiguous and the purpose of the component can be inferred from the name alone
    • The only data being stored in the state is data necessary for rendering and nothing else
    • The component has the minimum amount of code necessary for its purpose, and it is broken down into smaller components in order to separate concerns and functions
  • If the PR modifies code that runs when editing or sending messages, I tested and verified there is no unexpected behavior for all supported markdown - URLs, single line code, code blocks, quotes, headings, bold, strikethrough, and italic.
  • If the PR modifies a generic component, I tested and verified that those changes do not break usages of that component in the rest of the App (i.e. if a shared library or component like Avatar is modified, I verified that Avatar is working as expected in all cases)
  • If the PR modifies a component related to any of the existing Storybook stories, I tested and verified all stories for that component are still working as expected.
  • If the PR modifies a component or page that can be accessed by a direct deeplink, I verified that the code functions as expected when the deeplink is used - from a logged in and logged out account.
  • If the PR modifies the UI (e.g. new buttons, new UI components, changing the padding/spacing/sizing, moving components, etc) or modifies the form input styles:
    • I verified that all the inputs inside a form are aligned with each other.
    • I added Design label and/or tagged @Expensify/design so the design team can review the changes.
  • If the PR adds or modifies the UI:
    • I asked an AI agent to review the changes for accessibility issues and addressed its findings.
    • I tested with a screen reader (VoiceOver on macOS) and verified all new/changed elements are reachable with a logical focus order.
    • I verified all new/changed elements have meaningful accessible names and roles.
    • I verified state changes are announced (e.g. checked/unchecked, expanded/collapsed, selected).
  • For any bug fix or new feature in this PR, I verified that sufficient unit tests are included to prevent regressions in this flow.
  • If the main branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to the Test steps.
  • I have checked off every checkbox in the PR reviewer checklist, including those that don't apply to this PR.

Screenshots/Videos

Android: HybridApp
android.mov
Android: mWeb Chrome
iOS: HybridApp
iOS: mWeb Safari
MacOS: Chrome / Safari
web.mov

@melvin-bot

melvin-bot Bot commented Nov 13, 2026

Copy link
Copy Markdown

We did not find an internal engineer to review this PR, trying to assign a random engineer to #102213 as well as to this PR... Please reach out for help on Slack if no one gets assigned!

@melvin-bot
melvin-bot Bot requested a review from Julesssss November 13, 2026 05:28
Julesssss
Julesssss previously approved these changes Nov 13, 2026

@JmillsExpensify JmillsExpensify left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All good on my end

@situchan

situchan commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

@MelvinBot address #106752 (comment), #106752 (comment), #106752 (comment)

@MelvinBot

Copy link
Copy Markdown
Contributor Author

All three comments are valid based on code inspection:

  • Refresh/re-entry protection: completion refs reset on remount, while successful creation retains the draft, allowing another submission attempt.
  • Focus race: leaving Confirmation before success can bypass cleanup. usePrevious addresses that sequence, but not remounts.
  • Confirmation flash: focus-triggered cleanup leaves the completed screen in history. The visible flash remains unverified.

No code changed: these comments were authored by Julesssss, so implementation requires approval of that reviewer’s feedback. situchan, should I implement the combined draft-cleanup and completed-history fix?


view run

@situchan

Copy link
Copy Markdown
Contributor

@MelvinBot yes implement them if the fix is small, regression-free.

@MelvinBot

Copy link
Copy Markdown
Contributor Author

I left the PR unchanged because I couldn’t establish a small, regression-safe fix for all three concerns.

Draft cleanup and usePrevious are small changes, but history cleanup is not:

  • Replacing only Confirmation leaves earlier wizard steps beneath Success.
  • Replacing every step changes browser Back during unfinished flows—contrary to the intended behavior (navigation logic).

The combined fix needs completion-only history cleanup, with regression coverage for browser refresh, pending-request edits, and alternate entry points. I haven’t claimed those cases are regression-free or pushed an incomplete fix.


view run

@situchan

Copy link
Copy Markdown
Contributor

@MelvinBot implement only the draft cleanup and usePrevious, and leave the history as is

Co-authored-by: Situ Chandra Shil <situchan@users.noreply.github.com>
@MelvinBot
MelvinBot requested a review from a team as a code owner November 14, 2026 19:51
@melvin-bot
melvin-bot Bot requested review from situchan and removed request for a team November 14, 2026 19:51
@melvin-bot

melvin-bot Bot commented Nov 14, 2026

Copy link
Copy Markdown

@situchan Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button]

@MelvinBot

MelvinBot commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor Author

🤖 Web test steps verification results: ❌ fail

Blocked on dev NewDot web: the existing session was suspended, and the app rendered a blank page with zero snapshot nodes. No recovery, bypass, or simulated success was attempted.

Blank dev NewDot web page

Step Status
Draft clearing/retention, Confirmation refocus exit, and unfinished-step Back/edit behaviorUnable to verify because no app controls were accessible. This is an infrastructure blocker, not an observed regression.
Blank dev NewDot web page
❌

Pushed b23fe0f2: implemented successful-creation draft cleanup and usePrevious; history is unchanged.

Passed: 22 targeted tests, typecheck, lint, formatting, changed-file spelling, and Storybook smoke. Full Jest and compiler-comparison checks remain incomplete.


view run · no recording available

@MelvinBot

Copy link
Copy Markdown
Contributor Author

No code fix was warranted, so I didn’t push changes.

  • Independent approval: missing an eligible reviewer’s approval; requires human review.
  • Performance validation: the displayed failure belongs to a cancelled run with no executed steps. The newer run remains in progress.
  • All eight unit-test shards, typecheck, lint, formatting, spelling, Storybook, and builds passed.

view run

@MelvinBot

Copy link
Copy Markdown
Contributor Author

⚠️ Something went wrong. This may be a transient issue. Try again. If it persists, check status.openai.com.

Run details

@melvin-bot
melvin-bot Bot requested a review from Julesssss November 14, 2026 20:09
@Julesssss
Julesssss merged commit df5fbd0 into main Nov 16, 2026
60 of 86 checks passed
@Julesssss
Julesssss deleted the claude-internationalBankSuccessBack branch November 16, 2026 18:00
@OSBotify

Copy link
Copy Markdown
Contributor

✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release.

@github-actions

Copy link
Copy Markdown
Contributor

🚧 Julesssss has triggered a test Expensify/App build. You can view the workflow run here.

@github-actions

Copy link
Copy Markdown
Contributor

@OSBotify

Copy link
Copy Markdown
Contributor

🚀 Deployed to staging by https://github.com/Julesssss in version: 9.5.40-0 🚀

platform result
🕸 web 🕸 success ✅
🤖 android 🤖 success ✅
🍎 iOS 🍎 success ✅

@MelvinBot

Copy link
Copy Markdown
Contributor Author

No help site update needed — this fixes unintended resubmission after successful international bank-account setup without adding a feature or making existing article instructions incorrect.


view run

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

Labels

Melvin-Test-Android Melvin-Test-Web Triggers Melvin to run the testing steps of the PR on web

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants