Skip to content

Show the server bank verification error over the generic fallback in Collect deposit account - #105122

Merged
madmax330 merged 1 commit into
mainfrom
claude-collectDepositAccountErrorKey
Oct 28, 2026
Merged

madmax330 merged 1 commit into
mainfrom
claude-collectDepositAccountErrorKey

Conversation

@MelvinBot

@MelvinBot MelvinBot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Explanation of Change

When the bank check fails on the Collect deposit account "Check your info" page, PERSONAL_BANK_ACCOUNT.errors gets two entries: the server's specific "Please review your account number…" error (keyed by the server clock) and the generic walletPage.addBankAccountFailure fallback from failureData (keyed by the device clock). The Confirm page shows only getLatestError(...), so when the device clock runs ahead of the server, the generic error wins.

This PR keys the generic fallback in createCollectOnlyDepositAccount at 0, matching what addPersonalBankAccount already does in the same file. A server-sent error now always sorts newer. The generic text still shows when the server sends no error.

It also adds a unit test that applies a server error, then the failureData stamped with a device clock far ahead of the server, and checks that the server message still wins. The test fails without the fix.

Fixed Issues

$ #104723
PROPOSAL: #104723 (comment)

Tests

Precondition:

  1. As the admin in OldDot, create a new workspace
  2. Enable Workflows > "Collect bank account details" for this workspace
  3. Invite a new member without a personal bank account connected
  4. (Optional, makes the original bug reproduce reliably) Set the test device clock a few minutes ahead of real time

Steps:

  1. Login to the App as the member from Precondition Step 3
  2. Check an "Add deposit account" task with a "Fix" button is shown in the Time sensitive section of the Home tab
  3. Tap "Fix"
  4. Verify the Collect deposit account flow opens
  5. Complete the flow and add a bank account
  6. Tap "Confirm" on the "Check your info" page
  7. Verify that the warning is displayed with text "Please review your account number and routing number one more time before continuing..." and not "Unexpected error..."
  • Verify that no errors appear in the JS console

Offline tests

QA Steps

Precondition:

  1. As the admin in OldDot, create a new workspace
  2. Enable Workflows > "Collect bank account details" for this workspace
  3. Invite a new member without a personal bank account connected

Steps:

  1. Login to the App as the member from Precondition Step 3
  2. Check an "Add deposit account" task with a "Fix" button is shown in the Time sensitive section of the Home tab
  3. Tap "Fix"
  4. Verify the Collect deposit account flow opens
  5. Complete the flow and add a bank account
  6. Tap "Confirm" on the "Check your info" page
  7. Verify that the warning is displayed with text "Please review your account number and routing number one more time before continuing..." and not "Unexpected error..."
  • 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

…the Collect deposit account flow

Key the generic addBankAccountFailure error in createCollectOnlyDepositAccount failureData at 0, so a server-sent error always sorts newer even when the device clock runs ahead of the server.

Co-authored-by: huult <huult@users.noreply.github.com>
@MelvinBot
MelvinBot requested a review from a team October 27, 2026 11:40
@melvin-bot melvin-bot Bot added Melvin-Test-Android Melvin-Test-Web Triggers Melvin to run the testing steps of the PR on web labels Oct 27, 2026
@MelvinBot

Copy link
Copy Markdown
Contributor Author

I created this PR from an upstream branch since I don't have push access to your fork.

To take ownership of this branch and be able to push updates, run:

git remote add upstream https://github.com/Expensify/App.git
git fetch upstream claude-collectDepositAccountErrorKey
git checkout -b claude-collectDepositAccountErrorKey upstream/claude-collectDepositAccountErrorKey
git push -u origin claude-collectDepositAccountErrorKey

Then you can close this PR and open a new one from your fork.

@MelvinBot

MelvinBot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor Author

🤖 Web test steps verification results: ⚠️ partial

The PR has no written test steps, so I ran the repro steps from the linked issue with the fix applied. The test user signed in and finished onboarding, but I couldn't reach the "Check your info" page: every path into bank account entry is blocked by a "Validate your account" screen that needs a magic code emailed to the test inbox.
Validate your account magic-code screen blocking bank account entry

Step Status
Sign in as the test user and finish onboardingFinished onboarding with Workflows turned on. Landed on Home with a new workspace for the test user.
✅
Home tab shows an "Add deposit account" task with a "Fix" button in the Time sensitive sectionHome shows only the standard "Getting started" tasks. There is no "Add deposit account" task or Time sensitive section. I couldn't find or turn on Workflows > "Collect bank account details" on this workspace, so the precondition wasn't met.
Home tab with no Add deposit account task
❌
Open the Collect deposit account flowI tried Workspace > Workflows > Payments > Add bank account > Connect manually, and Account > Wallet > Add bank account. Both open "Validate your account", which needs a 6-digit code sent by email. Guessed codes were rejected. I also couldn't open /collect-deposit-account directly in this session.
Validate your account magic-code screen blocking bank account entry
❌
Enter bank details manually and reach "Check your info"Not reached because the validation screen blocked it.
❌
Tap "Confirm" and see "Please review your account number and routing number…" instead of "Unexpected error…"Not reached because the validation screen blocked it.
❌
No related errors in the JS consoleNot checked. The flow was never reached, and the web test tool can't read the console.
❌

view run · view recording

@MelvinBot

MelvinBot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor Author

🤖 Android test steps verification results: ❌ fail

The PR has no written test steps, so I ran the repro steps from the linked issue with the fix applied. The test user reached Home, but both bank account entry points stopped at a "Validate your account" screen that needs a code emailed to the test inbox, so the "Check your info" warning was never reached.
Validate your account screen blocking Wallet bank entry

Step Status
Test user is signed in on the Home tabThe app opened mid-onboarding. After finishing onboarding, the Home tab loaded.
Home tab after completing onboarding
✅
An "Add deposit account" task with a "Fix" button shows in the Time sensitive sectionTime sensitive shows only a "We can't send you email notifications" task. No "Add deposit account" task appeared, because the workspace precondition (Workflows > "Collect bank account details") couldn't be set up.
Home Time sensitive section with only the email notification task
❌
Tapping "Fix" (or a fallback entry) opens the Collect deposit account flowWith no "Fix" task, I used Workspace > Workflows > Payments > Add bank account, and Account > Wallet > Add bank account. Both opened the "Streamline payments" screen with "Log into your bank" and "Connect manually".
Add bank account entry screen
⚠️
Enter bank details manually and reach the "Check your info" page"Connect manually" on both routes opened "Validate your account", which needs a 6-digit code sent by email. The bank form and "Check your info" page were never shown.
Validate your account screen blocking workspace bank entry
Validate your account screen blocking Wallet bank entry
❌
Tap "Confirm" on the "Check your info" pageNot reached because the validation screen blocked it.
❌
Warning shows "Please review your account number and routing number…" and not "Unexpected error…"Not reached because the validation screen blocked it.
❌

view run · view recording

@huult

huult commented Oct 27, 2026

Copy link
Copy Markdown
Contributor

@MelvinBot Please update the test steps and QA steps to match the format used in #104723.

@MelvinBot

Copy link
Copy Markdown
Contributor Author

I updated the Tests and QA Steps sections in the PR description. They now use the same format as [$175] Android - Unexpected error text appears instead of Review text when connect BA: a "Precondition:" list followed by a "Steps:" list.

  • Tests: the issue's preconditions and steps, with step 7 now also checking that "Unexpected error..." does not appear. I added an optional fourth precondition: set the device clock a few minutes ahead. That clock skew is what made the generic error win, so it makes the original bug reproduce reliably.
  • QA Steps: the same steps for staging, without the clock precondition.

I kept the "Verify that no errors appear in the JS console" checkbox in both sections and removed the TODO placeholders. Please check the steps match what you ran before you mark the PR ready for review.


view run

@huult

huult commented Oct 27, 2026

Copy link
Copy Markdown
Contributor

@MelvinBot ready for review

@MelvinBot
MelvinBot marked this pull request as ready for review October 27, 2026 13:52
@MelvinBot
MelvinBot requested a review from a team as a code owner October 27, 2026 13:52
@MelvinBot

Copy link
Copy Markdown
Contributor Author

🤖 I marked this PR as ready for review.

Before a reviewer picks it up, please fill out the Tests and QA Steps sections. They still have TODO placeholders, and only the human co-author can fill them in.


view run

@melvin-bot
melvin-bot Bot requested review from huult and removed request for a team October 27, 2026 13:52
@melvin-bot

melvin-bot Bot commented Oct 27, 2026

Copy link
Copy Markdown

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

@melvin-bot
melvin-bot Bot requested review from trjExpensify and removed request for a team October 27, 2026 13:52
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

Codex Review Summary

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-27T13:56:15.443231Z 17603a4 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.

@huult

huult commented Oct 27, 2026 •

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
Screen.Recording.2026-10-27.at.21.52.19.mov
Android: mWeb Chrome
Screen.Recording.2026-10-27.at.21.54.42.mov
iOS: HybridApp
Screen.Recording.2026-10-27.at.21.59.47.mov
iOS: mWeb Safari
Screen.Recording.2026-10-27.at.22.01.45.mov
MacOS: Chrome / Safari
Screen.Recording.2026-10-27.at.21.45.22.mov

@huult

huult commented Oct 27, 2026

Copy link
Copy Markdown
Contributor

@MelvinBot I verified the PR: #105122 (comment). Please check off all the boxes in the author checklist.

@MelvinBot

Copy link
Copy Markdown
Contributor Author

🤖 I checked off all 36 boxes in the PR Author Checklist.

I didn't change anything else in the PR body. The "Verify that no errors appear in the JS console" boxes under Tests and QA Steps are still unchecked, and the Screenshots/Videos sections are still empty.


view run

@huult huult 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.

LGTM.

@melvin-bot
melvin-bot Bot requested a review from madmax330 October 27, 2026 15:12
@trjExpensify

Copy link
Copy Markdown
Contributor

I think the project team should have eyes on this as it's in active development. @arosiclair @dukenv0307 @bernhardoj.

@dukenv0307

Copy link
Copy Markdown
Contributor

@huult Actually, we decided to remove it in #103902 (comment). Why does this issue only occur on Android?

@huult

huult commented Oct 28, 2026

Copy link
Copy Markdown
Contributor

@huult Actually, we decided to remove it in #103902 (comment). Why does this issue only occur on Android?

@dukenv0307 This isn't Android-specific. It happens whenever the device clock is ahead of the server clock. There are two ways to get there:

  1. The device time is set ahead of the server time. I reproduced this on web by setting the clock 10 minutes ahead (API response mocked): main shows "Unexpected error…", this PR shows the BE error.
  2. The server time and the device time can differ because the server and the device are in different timezones. I remember hitting a timezone-related bug like this a few months ago, but I couldn't find the issue, so I can't confirm it's the same cause here.

In both cases the device-stamped fallback key outranks the BE key, since getLatestError takes the highest key. So keying the fallback at 0 makes sense here, and it's the same pattern addPersonalBankAccount and PayMoneyRequest already use.

@arosiclair arosiclair 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.

👍

@trjExpensify trjExpensify 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.

Team happy, I'm happy.

@madmax330
madmax330 merged commit cd86f72 into main Oct 28, 2026
58 of 61 checks passed
@madmax330
madmax330 deleted the claude-collectDepositAccountErrorKey branch October 28, 2026 22:01
@github-actions

Copy link
Copy Markdown
Contributor

🚧 madmax330 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

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

@OSBotify

Copy link
Copy Markdown
Contributor

🚀 Deployed to staging by https://github.com/madmax330 in version: 9.5.25-0 🚀

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

@MelvinBot

Copy link
Copy Markdown
Contributor Author

No help site update is needed. This bug fix only changes which in-app error message appears when a bank account check fails, so no help article sentence becomes incorrect.


view run

@OSBotify

Copy link
Copy Markdown
Contributor

🚀 Deployed to production by https://github.com/jasperhuangg in version: 9.5.25-2 🚀

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

Bundle Size Analysis (Sentry):

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.

7 participants