[HOLD for payment 2024-12-09] [$250] QBO - "Reconciliation account" disappears after selecting it
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.
- Open the app
- Navigate to Workspace settings - Accounting - Card reconciliation
- Enable "Continuous Reconciliation"
- 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
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 Owner
Current Issue Owner: @trjExpensify
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.
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?
- We should use
ErrorMessageRowto 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} />}
- Create a utility function that clears error message errors field of
ONYXKEYS.COLLECTION.PRIVATE_EXPENSIFY_CARD_SETTINGS}${workspaceAccountID - Pass the utility fucntion to
onCloseprop ofErrorMessageRow - 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
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)
Another one for your eyes @mountiny @MariaHCD @madmax330 @nkuoch @allgandalf @DylanDylann
Think it has to do more with Accounting and less expensify cards (Implementation wise), but happy to take this one on!
Gotcha, continuousReconciliation is only a feature of the Expensify Card.
@trjExpensify I already worked on Card reconciliation account setting Page before (when implementing the Expensify Card). Let me take this issue
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?
@mountiny @MariaHCD Tag you here because it relates to the Expensify Card. In this issue, we have 2 problems:
-
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) -
To set settlementBankAccountID we have two ways:
- In ExpensifyCard, we use ConfigureExpensifyCardsForPolicy API and It works well
- In the Card reconciliation page, we use UpdateCardSettlementAccount API and It is failed
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?
@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!
Maria is out assigning. I am also working partial day @nkuoch in case you could take a look earlier
@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?
Ahh thanks for pointing out that. I only can access to one mock bank account
@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 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 I think we should disable and lock the toggle if users haven't setup the settle bank account like this. Wdyt?
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
hide the Expensify card reconciliation option if you do not have exepnsify cards.
I thought that was the logic? π
Same, I thought we hid this when it didn't apply.
@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
@DylanDylann Updated proposal
@mountiny Should we open this issue for external contributors? If yes, @daledah's proposal looks fine
Job added to Upwork: https://www.upwork.com/jobs/~021860984129964489529
Current assignee @DylanDylann is eligible for the External assigner, not assigning anyone new.
π£ @DylanDylann π An offer has been automatically sent to your Upwork account for the Reviewer role π Thanks for contributing to the Expensify app!
π£ @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 π
@DylanDylann PR is ready.
Waiting for the PR to go to prod, melv.
Reviewing label has been removed, please complete the "BugZero Checklist".