Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[QBO] App crashes when toggling on "Sync reimbursed reports" #41894

Closed
6 tasks done
kbecciv opened this issue May 9, 2024 · 9 comments
Closed
6 tasks done

[QBO] App crashes when toggling on "Sync reimbursed reports" #41894

kbecciv opened this issue May 9, 2024 · 9 comments
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2

Comments

@kbecciv
Copy link

kbecciv commented May 9, 2024

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: 1.4.72-0
Reproducible in staging?: y
Reproducible in production?: y
Email or phone of affected tester (no customers): applausetester+kh250402@applause.expensifail.com
Logs: https://stackoverflow.com/c/expensify/questions/4856
logs Web.docx
Issue reported by: Applause - Internal Team

Action Performed:

Precondition:

  • Account is connected to QBO,
  1. Launch New Expensify app.
  2. Log in to applausetester+kh250402@applause.expensifail.com
  3. Go to Account settings > Workspaces > any workspace.
  4. Go to Accounting.
  5. Click Advanced.
  6. Toggle on "Sync reimbursed reports".

Expected Result:

"Sync reimbursed reports" can be toggled on.

Actual Result:

App crashes.
On web, it shows console error.

Workaround:

n/a

Platforms:

Which of our officially supported platforms is this issue occurring on?

  • Android: Native
  • Android: mWeb Chrome
  • iOS: Native
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Add any screenshot/video evidence

Bug6462640_1714124252111.web.mp4
Bug6462640_1714123895514.Android.mp4

View all open jobs on GitHub

@kbecciv kbecciv added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels May 9, 2024
Copy link

melvin-bot bot commented May 9, 2024

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

@kbecciv
Copy link
Author

kbecciv commented May 9, 2024

@anmurali FYI I haven't added the External label as I wasn't 100% sure about this issue. Please take a look and add the label if you agree it's a bug and can be handled by external contributors.

@ShridharGoel
Copy link
Contributor

Proposal

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

App crashes when toggling on "Sync reimbursed reports" .

What is the root cause of that problem?

The existing logic to pass settingValue fails when both qboAccountOptions and invoiceAccountCollectionOptions are empty since the first element would not exist. Also, if the first element is undefined/null, then .id would get called on that.

isSyncReimbursedSwitchOn ? '' : [...qboAccountOptions, ...invoiceAccountCollectionOptions][0].id,

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

onToggle: () => {
    let firstId = null
    const combinedOptions = [...qboAccountOptions, ...invoiceAccountCollectionOptions].filter(option => option);

    if (combinedOptions.length > 0) {
        firstId = combinedOptions[0].id;
    }

    return Connections.updatePolicyConnectionConfig(
        policyID,
        CONST.POLICY.CONNECTIONS.NAME.QBO,
        CONST.QUICK_BOOKS_CONFIG.COLLECTION_ACCOUNT_ID,
        isSyncReimbursedSwitchOn ? '' : firstId,
    )
},

@melvin-bot melvin-bot bot added the Overdue label May 13, 2024
Copy link

melvin-bot bot commented May 14, 2024

@anmurali Eep! 4 days overdue now. Issues have feelings too...

@trjExpensify
Copy link
Contributor

👋 @kbecciv can you share with us which Applause QBO account you used to connect here?

I tried the one under "Applause QBO" with applausetester+qbo@applause.expensifail.com in 1Password, and I can't reproduce it:

2024-05-14_23-33-18.mp4

@trjExpensify trjExpensify moved this to Release 1.5: XeroCon 2024 (June 12th) in [#whatsnext] #wave-collect May 14, 2024
@trjExpensify trjExpensify changed the title QBO - App crashes when toggling on "Sync reimbursed reports" [QBO] App crashes when toggling on "Sync reimbursed reports" May 14, 2024
@anmurali
Copy link

This is still being worked on, so not overdue.

@melvin-bot melvin-bot bot removed the Overdue label May 15, 2024
@kavimuru
Copy link

Tester is still able to reproduce this issue.

Screen_Recording_20240516_003404_One.UI.Home.mp4

@trjExpensify
Copy link
Contributor

^^ confirming if this is Android only or something in thread.

@trjExpensify
Copy link
Contributor

Alrighty, turns out they weren't trying with a new connection and that explains why I wasn't able to reproduce it repeatedly using the same QBO account. Closing!

@github-project-automation github-project-automation bot moved this from Release 1.5: XeroCon 2024 (June 12th) to Done in [#whatsnext] #wave-collect May 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2
Projects
No open projects
Archived in project
Development

No branches or pull requests

5 participants