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.54k stars 2.89k forks source link

[hold for payment 2024-09-26] [$250] iOS - Expense - App crash when clicking on the link settings/workspaces/:policyID/accounting/quic #47946

Closed IuliiaHerets closed 1 month ago

IuliiaHerets commented 2 months 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.24-1 Reproducible in staging?: Y Reproducible in production?: Y Issue was found when executing this PR: https://github.com/Expensify/App/pull/47696 Email or phone of affected tester (no customers): applausetester+23084alsn@applause.expensifail.com Issue reported by: Applause Internal Team

Action Performed:

  1. Go to www.staging.chat.expensify.com
  2. Workspace is connected to QBO
  3. Go settings/workspaces/:policyID/accounting/quickbooks-online/export/out-of-pocket-expense/account-select

Expected Result:

Verify list empty content is shown if no account is connected

Actual Result:

App crash when clicking on the link: settings/workspaces/:policyID/accounting/quickbooks-online/export/out-of-pocket-expense/account-select

Workaround:

Unknown

Platforms:

Screenshots/Videos

2308_1.txt

View all open jobs on GitHub

https://github.com/user-attachments/assets/9bbbbc9f-b4ff-41aa-a547-8ed45da8a9dd

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~0102861cb1eeae8b58
  • Upwork Job ID: 1828133199515812262
  • Last Price Increase: 2024-08-26
  • Automatic offers:
    • dukenv0307 | Contributor | 103743156
Issue OwnerCurrent Issue Owner: @brunovjk
IuliiaHerets commented 2 months ago

We think that this bug might be related to #wave-collect - Release 1

Nodebrute commented 2 months ago

Proposal

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

Expense - App crash when clicking on the link settings/workspaces/:policyID/accounting/quickbooks-online/export/out-of-pocket-expense/account-select

What is the root cause of that problem?

This error is not related to the QuickBooks integration. The crash is occurring due to an existing iOS bug where setIsInputInitialized(true) is being called in a loop, resulting in the 'Maximum update depth exceeded' error. https://github.com/Expensify/App/blob/f5e63543cbdea0ffcc0e5bf201f8f2e9645582c6/src/hooks/useAutoFocusInput.ts#L57

The issue is caused by an infinite loop triggered by`setIsInputInitialized(true)

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

To address the issue of redundant state updates and potential infinite loops in the useAutoFocusInput hook, here we should early return if inputRef.current is already set (i.e., the TextInput reference has already been assigned). We can do something like this.

if (inputRef.current) {
    return;
}

We can remove this as it's not working as expected

What alternative solutions did you explore? (Optional)

We can also keep the current logic

    if (inputRef.current || isInputInitialized) {
        return;
    }
github-actions[bot] commented 2 months ago

user Your proposal will be dismissed because you did not follow the proposal template.

Nodebrute commented 2 months ago

@IuliiaHerets Could you please re-add the labels? no one is assigned here

Nodebrute commented 2 months ago

Proposal

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

Expense - App crash when clicking on the link

What is the root cause of that problem?

This error is not related to the QuickBooks integration. The crash is occurring due to an existing iOS bug where setIsInputInitialized(true) is being called in a loop, resulting in the 'Maximum update depth exceeded' error. https://github.com/Expensify/App/blob/f5e63543cbdea0ffcc0e5bf201f8f2e9645582c6/src/hooks/useAutoFocusInput.ts#L57

The issue is caused by an infinite loop triggered by`setIsInputInitialized(true)

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

To address the issue of redundant state updates and potential infinite loops in the useAutoFocusInput hook, here we should early return if inputRef.current is already set (i.e., the TextInput reference has already been assigned). We can do something like this.

if (inputRef.current) {
    return;
}

We can remove this as it's not working as expected

What alternative solutions did you explore? (Optional)

We can also keep the current logic

    if (inputRef.current || isInputInitialized) {
        return;
    }
daledah commented 2 months ago

Proposal

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

App crash when clicking on the link: settings/workspaces/:policyID/accounting/quickbooks-online/export/out-of-pocket-expense/account-select

What is the root cause of that problem?

daledah commented 2 months ago

Proposal updated

melvin-bot[bot] commented 2 months ago

Triggered auto assignment to @deetergp (DeployBlockerCash), see https://stackoverflowteams.com/c/expensify/questions/9980/ for more details.

github-actions[bot] commented 2 months ago

:wave: Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:

  1. Identify the pull request that introduced this issue and revert it.
  2. Find someone who can quickly fix the issue.
  3. Fix the issue yourself.
melvin-bot[bot] commented 2 months ago

⚠️ Looks like this issue was linked to a Deploy Blocker here

If you are the assigned CME please investigate whether the linked PR caused a regression and leave a comment with the results.

If a regression has occurred and you are the assigned CM follow the instructions here.

If this regression could have been avoided please consider also proposing a recommendation to the PR checklist so that we can avoid it in the future.

melvin-bot[bot] commented 2 months ago

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

melvin-bot[bot] commented 2 months ago

Triggered auto assignment to Contributor-plus team member for initial proposal review - @brunovjk (External)

brunovjk commented 2 months ago

@Nodebrute, @daledah, did you use personal QBO accounts for testing?

daledah commented 2 months ago

@brunovjk Yes

brunovjk commented 2 months ago

Thank you @daledah. I'm trying to register one, there is no support in my country now, I'll review the proposals as soon as possible.

brunovjk commented 2 months ago

Excuse me @dukenv0307, would you mind taking this isse? I don't have QBO credentials yet, I believe this was a DB where you are the original C+? Thanks.

dukenv0307 commented 2 months ago

@brunovjk Yes, I can take it as C+ cc @deetergp

brunovjk commented 2 months ago

Thank you :D

melvin-bot[bot] commented 2 months ago

📣 @dukenv0307 🎉 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 📖

dukenv0307 commented 2 months ago

@daledah's proposal LGTM.

But we should change the policy type here to OnyxEntry<Policy>

Then use policy?.id like what we did in other places

🎀👀🎀 C+ reviewed

melvin-bot[bot] commented 2 months ago

Triggered auto assignment to @youssef-lr, see https://stackoverflow.com/c/expensify/questions/7972 for more details.

melvin-bot[bot] commented 2 months ago

📣 @daledah You have been assigned to this job! Please apply to the Upwork job and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review 🧑‍💻 Once you apply to this job, your Upwork ID will be stored and you will be automatically hired for future jobs! Keep in mind: Code of Conduct | Contributing 📖

daledah commented 2 months ago

@dukenv0307 PR is ready for review.

melvin-bot[bot] commented 1 month ago

This issue has not been updated in over 15 days. @deetergp, @youssef-lr, @dukenv0307, @daledah eroding to Monthly issue.

P.S. Is everyone reading this sure this is really a near-term priority? Be brave: if you disagree, go ahead and close it out. If someone disagrees, they'll reopen it, and if they don't: one less thing to do!

deetergp commented 1 month ago

I think the automation broke on this one. The PR has been reviewed, merged, and is currently out on production.

melvin-bot[bot] commented 1 month ago

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

joekaufmanexpensify commented 1 month ago

Yep, this is due for payment now.

joekaufmanexpensify commented 1 month ago

@dukenv0307 seems like this was a DB from a prior issue where you were C+, so thinking payment for you is not required here. Please let me know if you think that is not correct!

joekaufmanexpensify commented 1 month ago

Payment due here:

joekaufmanexpensify commented 1 month ago

@daledah offer for $250 sent!

dukenv0307 commented 1 month ago

@joekaufmanexpensify No it's not related to https://github.com/Expensify/App/pull/47696. The QA just saw this bug when they executed the PR

In withPolicy function, we pass policy prop as undefined in this case.

This problem even happened before https://github.com/Expensify/App/pull/47696

dukenv0307 commented 1 month ago

@Krishna2323 @yuwenmemon Do you agree with that ^?

joekaufmanexpensify commented 1 month ago

Got it, sounds good. TY for confirming!

joekaufmanexpensify commented 1 month ago

I updated the payment summary to reflect that you're due payment too.

joekaufmanexpensify commented 1 month ago

All set to issue payment!

joekaufmanexpensify commented 1 month ago

@daledah $250 sent and contract ended!

joekaufmanexpensify commented 1 month ago

@dukenv0307 $250 sent and contract ended!

joekaufmanexpensify commented 1 month ago

Upwork job closed.

joekaufmanexpensify commented 1 month ago

All set, TY everyone!