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.29k stars 2.73k forks source link

[HOLD for payment 2024-07-24] LHN not displayed after page refresh from settings page #44860

Closed m-natarajan closed 1 month ago

m-natarajan 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.4-0 Reproducible in staging?: Yes Reproducible in production?: Yes If this was caught during regression testing, add the test name, ID and link from TestRail: Email or phone of affected tester (no customers): Logs: https://stackoverflow.com/c/expensify/questions/4856 Expensify/Expensify Issue URL: Issue reported by: @suneox Slack conversation: https://expensify.slack.com/archives/C05LX9D6E07/p1720062549074999

Action Performed:

  1. Go to staging.new.expensify.com
  2. Click Settings > About
  3. Refresh the page

    Expected Result:

    Page reloads with out any issue

    Actual Result:

    LHN menu not displayed until navigated to other menu icon

    Workaround:

    Can the user still use Expensify without this being fixed? Have you informed them of the workaround?

Platforms:

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

Screenshots/Videos

https://github.com/Expensify/App/assets/38435837/4e9d1846-c1fa-4a64-92a8-9aa017da1732

https://github.com/Expensify/App/assets/38435837/59988534-303d-43c1-9f52-e2a91f63d275

Add any screenshot/video evidence

View all open jobs on GitHub

Issue OwnerCurrent Issue Owner: @sonialiap
melvin-bot[bot] commented 2 months ago

Triggered auto assignment to @iwiznia (AutoAssignerNewDotQuality)

melvin-bot[bot] commented 2 months ago

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

ShridharGoel commented 2 months ago

Proposal

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

LHN not displayed after page refresh from settings page. Also, menu options inside the about page are not clickable.

What is the root cause of that problem?

Coin animation loading freezes the page.

https://github.com/Expensify/App/blob/8ec71d6d0ff38f58f2c07396a0963359382ba82a/src/pages/settings/AboutPage/AboutPage.tsx#L148

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

We can do an async load of the animation in this way:

Add the below in Lottie/index.tsx:

const [animationFile, setAnimationFile] = useState<string | AnimationObject | {uri: string}>();

useEffect(() => {
    setAnimationFile(source.file);
}, [setAnimationFile, source.file]);

Now, update to return the below:

animationFile ? <LottieView
    // eslint-disable-next-line react/jsx-props-no-spreading
    {...props}
    source={animationFile}
    ref={ref}
    style={[aspectRatioStyle, props.style]}
    webStyle={{...aspectRatioStyle, ...webStyle}}
    onAnimationFailure={() => setIsError(true)}
/> : null

This will fix it for all usages of Lottie animations.

suneox commented 2 months ago

Thank @ShridharGoel proposal, but this issue also happens on other settings screens that use Lottie. This issue only started occurring in a few recent releases, so could you please find the offending PR?

ShridharGoel commented 2 months ago

@suneox It has started happening because we have switched to concurrent mode. We can fix this at all places using a common base logic for Lottie animations.

suneox commented 2 months ago

@suneox It has started happening because we have switched to concurrent mode.

@ShridharGoel Thank you. I also tried reverting the code before the merge commit #42592, and the issue doesn’t happen. It only occurs after commit d047467a enabled React concurrent mode.

We can fix this at all places using a common base logic for Lottie animations.

We don’t need to fix this at all places using Lottie; we just need to fix it in Lottie/index.tsx.

@iwiznia We can fix this issue based on this proposal and implement the fix in Lottie/index.tsx. I have tested it, and it works as expected.

ShridharGoel commented 2 months ago

We don’t need to fix this at all places using Lottie; we just need to fix it in Lottie/index.tsx.

Yes, that's what I meant by the common base logic. Will update to include code example.

suneox commented 1 month ago

Waiting for @ShridharGoel to create the PR.

ShridharGoel commented 1 month ago

Will open PR by tomorrow.

ShridharGoel commented 1 month ago

@sonialiap Should this have the "High Priority" label since it was marked as critical?

melvin-bot[bot] commented 1 month ago

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

melvin-bot[bot] commented 1 month ago

The solution for this issue has been :rocket: deployed to production :rocket: in version 9.0.7-8 and is now subject to a 7-day regression period :calendar:. Here is the list of pull requests that resolve this issue:

If no regressions arise, payment will be issued on 2024-07-24. :confetti_ball:

For reference, here are some details about the assignees on this issue:

melvin-bot[bot] commented 1 month ago

BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:

suneox commented 1 month ago
sonialiap commented 1 month ago

Payment summary:

suneox commented 1 month ago
  • @suneox $250 - offer sent in upwork

@sonialiap Thank you, I have accepted an offer

melvin-bot[bot] commented 1 month ago

Payment Summary

[Upwork Job]()

BugZero Checklist (@sonialiap)

sonialiap commented 1 month ago

This issue was Critical and High Priority so I've adjusted the payouts to $500

suneox commented 1 month ago

This issue was Critical and High Priority so I've adjusted the payouts to $500

Thank you. I really appreciate your recognition of our task.