Expensify / App

Welcome to New Expensify: a complete re-imagination of financial collaboration, centered around chat. Help us build the next generation of Expensify by sharing feedback and contributing to the code.
https://new.expensify.com
MIT License
3.55k stars 2.89k forks source link

QBO - "Reconciliation account" disappears after selecting it #52548

Open IuliiaHerets opened 8 hours ago

IuliiaHerets commented 8 hours ago

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.0.62-1 Reproducible in staging?: Y Reproducible in production?: Y Issue was found when executing this PR: https://github.com/Expensify/App/pull/51359 Email or phone of affected tester (no customers): Issue reported by: Applause Internal Team

Action Performed:

Preconditions:

  1. Open the app
  2. Navigate to Workspace settings - Accounting - Card reconciliation
  3. Enable "Continuous Reconciliation"
  4. Click on your added bank account

Expected Result:

"Reconciliation account" should still be visible.

Actual Result:

"Reconciliation account" disappears after selecting it.

Workaround:

Unknown

Platforms:

Screenshots/Videos

https://github.com/user-attachments/assets/853c67b3-22a6-413e-9901-2a8e51ecb8b4

View all open jobs on GitHub

melvin-bot[bot] commented 8 hours ago

Triggered auto assignment to @trjExpensify (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.

etCoderDysto commented 8 hours ago

Edited by proposal-police: This proposal was edited at 2024-11-14 12:38:30 UTC.

Proposal

Please re-state the problem that we are trying to solve in this issue.

QBO - "Reconciliation account" disappears after selecting it

What is the root cause of that problem?

When trying to add a bank account on step 4, the network request fails, and error message from onyx will be stored in cardSettings.errors, but we are not displaying the error message in CardReconciliationPage.

cardSettings.errors https://github.com/Expensify/App/blob/512ae9f1a1c6d840065f377264bc1ab009356f0f/src/pages/workspace/accounting/reconciliation/CardReconciliationPage.tsx#L35 Onyx failure data

https://github.com/Expensify/App/blob/512ae9f1a1c6d840065f377264bc1ab009356f0f/src/libs/actions/Card.ts#L357-L364

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

  1. We should use ErrorMessageRow to display the error message below https://github.com/Expensify/App/blob/512ae9f1a1c6d840065f377264bc1ab009356f0f/src/pages/workspace/accounting/reconciliation/CardReconciliationPage.tsx#L96
{cardSettings?.errors && <ErrorMessageRow errors={cardSettings?.errors} />}
  1. Create a utility function that clears error message errors field of ONYXKEYS.COLLECTION.PRIVATE_EXPENSIFY_CARD_SETTINGS}${workspaceAccountID
  2. Pass the utility fucntion to onClose prop of ErrorMessageRow
  3. Change styles according to design

Optionally, in failure data we can pass settlementBankAccountID to paymentBankAccountID to prevent the failed bank account from disappearing form Card reconciliation page, and change the bank to any available previous bank account by reseting paymentBankAccountID value to currentSettlementBankAccountID in the utility function

What alternative solutions did you explore? (Optional)

Result https://github.com/user-attachments/assets/459f8203-9cd5-4d1a-aae8-b5736a40efc0

Note we will fix the style