App icon indicating copy to clipboard operation
App copied to clipboard

[HOLD for payment 2024-12-09] [$250] QBO - "Reconciliation account" disappears after selecting it

Open IuliiaHerets opened this issue 1 year ago β€’ 37 comments

If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] 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:

  • Use a new Gmail account.
  • Expensify Card is enabled.
  • Bank account is added in Expensify Card page.
  • Workspace is connected to QBO.
  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:

  • [ ] Android: Standalone
  • [ ] Android: HybridApp
  • [x] Android: mWeb Chrome
  • [ ] iOS: Standalone
  • [ ] iOS: HybridApp
  • [ ] iOS: mWeb Safari
  • [x] MacOS: Chrome / Safari
  • [ ] MacOS: Desktop

Screenshots/Videos

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

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021860984129964489529
  • Upwork Job ID: 1860984129964489529
  • Last Price Increase: 2024-11-25
  • Automatic offers:
    • DylanDylann | Reviewer | 105055923
    • daledah | Contributor | 105055925
Issue OwnerCurrent Issue Owner: @trjExpensify

IuliiaHerets avatar Nov 14 '24 11:11 IuliiaHerets

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.

melvin-bot[bot] avatar Nov 14 '24 11:11 melvin-bot[bot]

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

etCoderDysto avatar Nov 14 '24 12:11 etCoderDysto

Edited by proposal-police: This proposal was edited at 2024-11-15 09:37:35 UTC.

Proposal

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

Bug 1: "Reconciliation account" disappears after selecting it. Bug 2: Error message is not displayed when API is not called successfully.

What is the root cause of that problem?

Bug 1

We still display the Continuous Reconciliation toggle even though users haven't set up settlement bank account

Bug 2: Optional:

  • We don't have logic to display the error:

https://github.com/Expensify/App/blob/a6f1348d08a441f4f9b48a8ef05e5e95c96b53d7/src/pages/workspace/accounting/reconciliation/CardReconciliationPage.tsx#L109-L117 when API UpdateCardSettlementAccount encountered error.

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

https://github.com/Expensify/App/blob/5f483dc37ccfbb967d8eeb49302d3dfa010f93e9/src/pages/workspace/accounting/PolicyAccountingPage.tsx#L288

We only should push cardReconciliation to configurationOptions if workspaceAccountID && areExpensifyCardEnabled

If user go to Card reconciliation by deeplink I suggest displaying the not found page or display a locked toggle (also use this condition workspaceAccountID && areExpensifyCardEnabled)

Additional we still can update the error handle if needed

  • We can display the error message in:

https://github.com/Expensify/App/blob/a6f1348d08a441f4f9b48a8ef05e5e95c96b53d7/src/pages/workspace/accounting/reconciliation/CardReconciliationPage.tsx#L110


                        <MenuItemWithTopDescription errorText={errorText} ... />

with errorText = Object.values(getLatestError(cardSettings?.errors)).at(0).

The error message should be displayed in the MenuItemWithTopDescription because the error is related to paymentBankAccountID field.

What alternative solutions did you explore? (Optional)

daledah avatar Nov 15 '24 09:11 daledah

Another one for your eyes @mountiny @MariaHCD @madmax330 @nkuoch @allgandalf @DylanDylann

trjExpensify avatar Nov 15 '24 12:11 trjExpensify

Think it has to do more with Accounting and less expensify cards (Implementation wise), but happy to take this one on!

allgandalf avatar Nov 15 '24 12:11 allgandalf

Gotcha, continuousReconciliation is only a feature of the Expensify Card.

trjExpensify avatar Nov 15 '24 12:11 trjExpensify

@trjExpensify I already worked on Card reconciliation account setting Page before (when implementing the Expensify Card). Let me take this issue

DylanDylann avatar Nov 18 '24 04:11 DylanDylann

I agreed with @daledah about Bug 1, in case the user go to accounting page right after login successful we also need to display the bank account list

About the main bug on OP, @daledah @etCoderDysto could anyone help to explain why the API failed?

DylanDylann avatar Nov 18 '24 04:11 DylanDylann

@mountiny @MariaHCD Tag you here because it relates to the Expensify Card. In this issue, we have 2 problems:

  1. In case the user goes to the Card reconciliation page right after login is successful we also need to display the bank account list. To do that, private_expensifyCardSettings_ needs to be available when the user goes to the Card reconciliation Page. Currently, It is only available after we call API OpenPolicyExpensifyCardsPage (going to Expensify Card Page)

  2. To set settlementBankAccountID we have two ways:

  • In ExpensifyCard, we use ConfigureExpensifyCardsForPolicy API and It works well
Screenshot 2024-11-18 at 12 01 58 Screenshot 2024-11-18 at 12 02 05
  • In the Card reconciliation page, we use UpdateCardSettlementAccount API and It is failed
Screenshot 2024-11-18 at 12 01 34 Screenshot 2024-11-18 at 12 01 41

TBH, I don't understand why UpdateCardSettlementAccount API is failed in this case and ConfigureExpensifyCardsForPolicy still be successful. Could you please help to take a look?

DylanDylann avatar Nov 18 '24 05:11 DylanDylann

@trjExpensify I already worked on Card reconciliation account setting Page before (when implementing the Expensify Card). Let me take this issue

Assigned you to help progress!

trjExpensify avatar Nov 18 '24 14:11 trjExpensify

Maria is out assigning. I am also working partial day @nkuoch in case you could take a look earlier

mountiny avatar Nov 18 '24 15:11 mountiny

@DylanDylann What bank accounts did you use to try it?

Did you provision the policy first and then you tried switching the bank account? You will have to use a different bank account for that and there is only one testing bank account you have access to right? So did you try switching to different bank account?

mountiny avatar Nov 20 '24 12:11 mountiny

Ahh thanks for pointing out that. I only can access to one mock bank account

DylanDylann avatar Nov 20 '24 13:11 DylanDylann

@mountiny You mean that if we haven't set up a settlement bank account, we shouldn't have access to Select Reconciliation account page.

DylanDylann avatar Nov 20 '24 13:11 DylanDylann

@DylanDylann Yeah, I think if you do not have bank account set up, there is nothing to choose there. But also you cannot have expensify cards without settlement bank account

mountiny avatar Nov 21 '24 13:11 mountiny

@mountiny I think we should disable and lock the toggle if users haven't setup the settle bank account like this. Wdyt?

Screenshot 2024-11-22 at 16 25 02

DylanDylann avatar Nov 22 '24 09:11 DylanDylann

Updated proposal

daledah avatar Nov 22 '24 11:11 daledah

Discussing internally cc @trjExpensify @JmillsExpensify

Maybe we should lock it or even hide the Expensify card reconciliation option if you do not have exepnsify cards. Or show some graphics CTA for the user in RHP to inform them about ECard option

mountiny avatar Nov 22 '24 12:11 mountiny

hide the Expensify card reconciliation option if you do not have exepnsify cards.

I thought that was the logic? πŸ˜•

trjExpensify avatar Nov 22 '24 13:11 trjExpensify

Same, I thought we hid this when it didn't apply.

JmillsExpensify avatar Nov 22 '24 13:11 JmillsExpensify

@DylanDylann there is the answer, lets hide the button and add lock the toggle in case of a deeplink to that RHP page if cards are not provisioned that is no workspaceAccountID + areExpensifyCardEnabled

mountiny avatar Nov 22 '24 14:11 mountiny

@DylanDylann Updated proposal

daledah avatar Nov 22 '24 16:11 daledah

@mountiny Should we open this issue for external contributors? If yes, @daledah's proposal looks fine

DylanDylann avatar Nov 23 '24 16:11 DylanDylann

Job added to Upwork: https://www.upwork.com/jobs/~021860984129964489529

melvin-bot[bot] avatar Nov 25 '24 09:11 melvin-bot[bot]

Current assignee @DylanDylann is eligible for the External assigner, not assigning anyone new.

melvin-bot[bot] avatar Nov 25 '24 09:11 melvin-bot[bot]

πŸ“£ @DylanDylann πŸŽ‰ An offer has been automatically sent to your Upwork account for the Reviewer role πŸŽ‰ Thanks for contributing to the Expensify app!

Offer link Upwork job

melvin-bot[bot] avatar Nov 25 '24 09:11 melvin-bot[bot]

πŸ“£ @daledah πŸŽ‰ An offer has been automatically sent to your Upwork account for the Contributor role πŸŽ‰ Thanks for contributing to the Expensify app!

Offer link Upwork job Please accept the offer and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review πŸ§‘β€πŸ’» Keep in mind: Code of Conduct | Contributing πŸ“–

melvin-bot[bot] avatar Nov 25 '24 09:11 melvin-bot[bot]

@DylanDylann PR is ready.

daledah avatar Nov 25 '24 16:11 daledah

Waiting for the PR to go to prod, melv.

trjExpensify avatar Dec 02 '24 13:12 trjExpensify

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

melvin-bot[bot] avatar Dec 02 '24 21:12 melvin-bot[bot]