Skip to content

Disable the workspace bank account row offline unless the reimburser is unlocking a locked account - #102839

Merged
francoisl merged 2 commits into
mainfrom
claude-bankAccountRowOfflineDisabled
Oct 2, 2026
Merged

francoisl merged 2 commits into
mainfrom
claude-bankAccountRowOfflineDisabled

Conversation

@MelvinBot

@MelvinBot MelvinBot commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

Explanation of Change

In Workspace → Workflows → Payments, a partly set up bank account row (with the "Incomplete" badge) could be pressed while offline. Pressing it opened the bank account flow, which only shows "You appear to be offline."

The cause is #101450. It removed the offline check from the bank account row for every state, so a locked account's reimburser could request an unlock offline. Only that unlock request works offline, because it is queued optimistically. Every other press opens the bank account flow, which needs a connection.

This PR adds isBankAccountRowBlockedOffline in WorkflowsPaymentsTab.tsx. It is true when the user is offline, unless the account is locked and the user is the reimburser. The flag is added back to canInteractWithBankAccountRow and the row uses it as its interactive prop, so the row can't be pressed offline but isn't greyed out. The "Finish" button already uses !canInteractWithBankAccountRow, so it is disabled offline too. The locked-account unlock flow still works offline.

I added two UI tests to tests/ui/WorkspaceWorkflowsLockedBankAccountTest.tsx for an incomplete (SETUP) bank account:

  • Online, pressing "Finish" opens the bank account flow.
  • Offline, pressing the row or "Finish" does not open the bank account flow. This test fails without the fix.

The existing locked-account offline tests still pass.

AI tests run locally:

  • npm test -- tests/ui/WorkspaceWorkflowsLockedBankAccountTest.tsx: 4 of 4 pass
  • npm run typecheck: passes
  • npm run lint on the changed files: passes
  • npm run fmt: no changes
  • npm run react-compiler-compliance-check check on WorkflowsPaymentsTab.tsx: passes
  • npm run spell-changed: no issues
  • The full Jest suite and Storybook smoke test were not run locally. CI covers them.
  • Browser verification could not run because the automated web test session loaded a blank page.

Fixed Issues

$ #102329
PROPOSAL: #102329 (comment)

Tests

Same as QA

  • Verify that no errors appear in the JS console

Offline tests

QA Steps

Precondition: You are a workspace admin, and the workspace has a partly added bank account. To set this up, go to Workspace > Workflows > Payments, start adding a bank account, and exit the flow before you finish.

Incomplete bank account, offline

  1. Go to Workspace > Workflows > Payments.
  2. Verify the bank account row shows the "Incomplete" badge and a "Finish" button.
  3. Go offline.
  4. Verify the bank account row can't be pressed and the "Finish" button looks disabled.
  5. Press the bank account row. Verify nothing opens, and you don't see "You appear to be offline. This feature requires an active internet connection."
  6. Press "Finish". Verify nothing opens.

Incomplete bank account, online

  1. Go back online.
  2. Verify the bank account row and the "Finish" button are enabled.
  3. Press "Finish". Verify the bank account setup flow opens.

Regression: locked bank account, offline

Precondition: The workspace has a locked business bank account, and you are the workspace's reimburser.

  1. Go to Workspace > Workflows > Payments and go offline.
  2. Verify you can still press the locked bank account row and send the unlock request.
  3. Sign in as a workspace admin who is not the reimburser, and go offline. Verify the locked bank account row offers no unlock action.
  • 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 followed proper code patterns (see Reviewing the code)
    • I verified that comments were added to code that is not self explanatory
    • I verified that any new or modified comments were clear, correct English, and explained "why" the code was doing something instead of only explaining "what" the code was doing.
    • I verified any copy / text that was added to the app is grammatically correct in English. It adheres to proper capitalization guidelines (note: only the first word of header/labels should be capitalized), and 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 followed the guidelines as stated in the Review Guidelines
  • 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 a new CSS style is added I verified that:
    • A similar style doesn't already exist
    • The style can't be created with an existing StyleUtils function (i.e. StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))
  • 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

…is unlocking a locked account

Co-authored-by: DylanDylann <DylanDylann@users.noreply.github.com>
@MelvinBot
MelvinBot requested a review from a team October 2, 2026 07:33
@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 2, 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-bankAccountRowOfflineDisabled
git checkout -b claude-bankAccountRowOfflineDisabled upstream/claude-bankAccountRowOfflineDisabled
git push -u origin claude-bankAccountRowOfflineDisabled

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

const canInteractWithBankAccountRow = canWritePayments && !isBankAccountPendingDelete;
// The reimburser's unlock request on a locked account is queued optimistically, so it works offline. Every other press
// opens the bank account flow, which needs a connection.
const isBankAccountRowBlockedOffline = isOffline && !(isBusinessBankAccountLocked && isUserReimburser);

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.

@MelvinBot Why do we need to add this condition? !(isBusinessBankAccountLocked && isUserReimburser);

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.

@MelvinBot Why do we need to add this condition? !(isBusinessBankAccountLocked && isUserReimburser);

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.

My understanding is that it's because you should still be able to start an optimistic unlock request while offline when your account is locked and you're the reimburser.

@MelvinBot

MelvinBot commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor Author

🤖 Android test steps verification results: ❌ fail

The test was blocked before any step could run. To create the "Incomplete" bank account precondition, the "Add bank account" flow asks for an emailed account validation code, and that code can't be read in this CI session. The PR's Tests section is still a TODO, so the planned steps came from the linked issue and the PR description.
Validate your account screen rejecting the dev test OTP 000000

Step Status
Precondition: workspace with an Incomplete bank account row in Workflows → PaymentsA workspace was created and Payments was on. The tester opened "Add bank account" → "Connect manually", and the app showed the "Validate your account" screen, which needs a security code sent by email. The dev test code 000000 was rejected ("Incorrect or invalid magic code"). Because the Incomplete state could not be reached, steps 1–5 did not run: Incomplete badge online, row disabled offline, no "You appear to be offline" panel on press, "Finish" disabled offline, and the flow opening online.
Workflows Payments tab with Add bank account entry
Validate your account screen rejecting the dev test OTP 000000
❌

To unblock this, give the test a pre-validated account that already has a partly set up workspace bank account. You could also fill in the PR's Tests section so the steps are documented.


view run · view recording

@MelvinBot

Copy link
Copy Markdown
Contributor Author

The condition keeps one case pressable offline: a reimburser unlocking a locked bank account. Without it, the row would be disabled offline in every state, and that would undo Allow the workflows bank account row to be tapped while offline.

When you press the row, one of these happens:

  • If the account is locked and you are the reimburser, the press calls pressLockedBankAccount and opens Concierge (WorkflowsPaymentsTab.tsx:223-230). The unlock request is optimistic, so it queues offline and sends after you reconnect.
  • Otherwise, the press opens the bank account flow (WorkflowsPaymentsTab.tsx:240). That flow needs a connection, so offline it only shows "You appear to be offline." This is the bug in this PR's linked issue.

That's why line 169 blocks the row offline except in that one case. The existing test "lets the reimburser request an unlock while offline" (WorkspaceWorkflowsLockedBankAccountTest.tsx:190) would fail without the exception.


view run

@DylanDylann

Copy link
Copy Markdown
Contributor

@MelvinBot Please fill the QA Steps

@DylanDylann

Copy link
Copy Markdown
Contributor

@MelvinBot Mark this PR as ready for review

@MelvinBot

Copy link
Copy Markdown
Contributor Author

I filled in the QA Steps section of the PR description. The steps cover three cases:

  • An incomplete bank account offline: the row and "Finish" are disabled, and pressing them opens nothing.
  • The same account online: "Finish" opens the bank account setup flow.
  • A locked bank account offline (regression check): the reimburser can still send the unlock request, and other admins see no unlock action.

The Tests and Offline tests sections are still empty. They need the steps a person actually ran, so you'll need to fill them in.


view run

@MelvinBot

Copy link
Copy Markdown
Contributor Author

I couldn't mark this PR as ready for review. This run doesn't have permission to change the PR's draft status, so it is still a draft.

To mark it ready yourself, use the "Ready for review" button at the bottom of the PR page.


view run

@DylanDylann

DylanDylann commented Oct 2, 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 proper code patterns were followed (see Reviewing the code)
    • I verified that any callback methods that were added or modified are named for what the method does and never what callback they handle (i.e. toggleReport and not onIconClick).
    • I verified that comments were added to code that is not self explanatory
    • I verified that any new or modified comments were clear, correct English, and explained "why" the code was doing something instead of only explaining "what" the code was doing.
    • I verified any copy / text that was added to the app is grammatically correct in English. It adheres to proper capitalization guidelines (note: only the first word of header/labels should be capitalized), and 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 that this PR follows the guidelines as stated in the Review Guidelines
  • 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 and each prop has a /** comment above it */
    • The file is named correctly
    • 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
    • For Class Components, any internal methods passed to components event handlers are bound to this properly so there are no scoping issues (i.e. for onClick={this.submit} the method this.submit should be bound to this in the constructor)
    • Any internal methods bound to this are necessary to be bound (i.e. avoid this.submit = this.submit.bind(this); if this.submit is never passed to a component event handler like onClick)
    • All JSX used for rendering exists in the render method
    • 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 any new file was added I verified that:
    • The file has a description of what it does and/or why is needed at the top of the file if the code is not self explanatory
  • If a new CSS style is added I verified that:
    • A similar style doesn't already exist
    • The style can't be created with an existing StyleUtils function (i.e. StyleUtils.getBackgroundAndBorderStyle(theme.componentBG)
  • 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.
  • 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 Screenshot 2026-10-02 at 15 12 45
Android: mWeb Chrome Screenshot 2026-10-02 at 15 14 37
iOS: HybridApp Screenshot 2026-10-02 at 15 11 29
iOS: mWeb Safari Screenshot 2026-10-02 at 15 12 18
MacOS: Chrome / Safari Screenshot 2026-10-02 at 15 17 18

sentryLabel: CONST.SENTRY_LABEL.WORKSPACE.WORKFLOWS.BANK_ACCOUNT,
shouldGreyOutWhenDisabled: !policy?.pendingFields?.reimbursementChoice,
disabled: !canWritePayments || isBankAccountPendingDelete,
disabled: isBankAccountRowBlockedOffline || !canWritePayments || isBankAccountPendingDelete,

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.

@MelvinBot I think we should update interactive instead of disabled

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.

@MelvinBot I think we should update interactive instead of disabled

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done. The offline flag is now in interactive instead of disabled, in WorkflowsPaymentsTab.tsx:259-261:

  • disabled is back to !canWritePayments || isBankAccountPendingDelete.
  • interactive now uses canInteractWithBankAccountRow, which includes the offline check.

Offline, the row can't be pressed, but it isn't greyed out. The "Finish" button is still disabled offline. I also updated the PR description and QA step 4 to match.

The 4 tests in WorkspaceWorkflowsLockedBankAccountTest.tsx pass, and typecheck passes.


view run

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This change is already pushed in commit 9744837. The offline check now lives in interactive, and disabled is back to !canWritePayments || isBankAccountPendingDelete (WorkflowsPaymentsTab.tsx:259-261). Offline, you can't press the row, but it isn't greyed out. No further changes are needed for this comment.


view run

Co-authored-by: DylanDylann <DylanDylann@users.noreply.github.com>
@melvin-bot

melvin-bot Bot commented Oct 2, 2026

Copy link
Copy Markdown

We did not find an internal engineer to review this PR, trying to assign a random engineer to #102329 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 francoisl October 2, 2026 08:17
@DylanDylann

Copy link
Copy Markdown
Contributor

@francoisl All good to go. I can't ask Melvin to mark this PR as ready, and I'm also not able to do it myself. Could you please help mark it as ready and take a look? Thanks

@mountiny
mountiny marked this pull request as ready for review October 2, 2026 11:41
@mountiny
mountiny requested a review from a team as a code owner October 2, 2026 11:41
@melvin-bot
melvin-bot Bot requested review from DylanDylann and removed request for a team October 2, 2026 11:41
@melvin-bot

melvin-bot Bot commented Oct 2, 2026

Copy link
Copy Markdown

@DylanDylann 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 joekaufmanexpensify and removed request for a team October 2, 2026 11:41
@francoisl

Copy link
Copy Markdown
Contributor

Precondition: The workspace has a locked business bank account, and you are the workspace's reimburser.

Not sure if the QA team has a test account like this, let's see.

const canInteractWithBankAccountRow = canWritePayments && !isBankAccountPendingDelete;
// The reimburser's unlock request on a locked account is queued optimistically, so it works offline. Every other press
// opens the bank account flow, which needs a connection.
const isBankAccountRowBlockedOffline = isOffline && !(isBusinessBankAccountLocked && isUserReimburser);

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.

My understanding is that it's because you should still be able to start an optimistic unlock request while offline when your account is locked and you're the reimburser.

@francoisl
francoisl merged commit fbf8d2a into main Oct 2, 2026
50 of 55 checks passed
@francoisl
francoisl deleted the claude-bankAccountRowOfflineDisabled branch October 2, 2026 18:10
@github-actions

github-actions Bot commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

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

@OSBotify

OSBotify commented Oct 2, 2026

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 OSBotify mentioned this pull request Oct 4, 2026
59 tasks done
@OSBotify

OSBotify commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

🚀 Deployed to staging by https://github.com/francoisl in version: 9.5.2-0 🚀

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

@MelvinBot

Copy link
Copy Markdown
Contributor Author

No help site update needed. This PR fixes a bug so the bank account row in Workflows > Payments can't be pressed offline, and no existing article describes the old behavior. The current article already says this section is disabled offline, which the fix makes true again.

@m-natarajan

Copy link
Copy Markdown

@DylanDylann This PR is failing because of a regression issue #97679

@OSBotify

OSBotify commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

🚀 Deployed to production by https://github.com/Julesssss in version: 9.5.2-4 🚀

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.

5 participants