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

[HOLD for payment 2023-09-07] [$1000] Chat - Opened chat does not show up in LHN when LHN is loading #24596

Closed
2 of 6 tasks
lanitochka17 opened this issue Aug 15, 2023 · 37 comments
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Daily KSv2 Engineering External Added to denote the issue can be worked on by a contributor

Comments

@lanitochka17
Copy link

lanitochka17 commented Aug 15, 2023

If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!


Issue found when executing PR #24204

Action Performed:

  1. Go to staging.new.expensify.com
  2. Log in with account with many conversations
  3. Copy link to any chat
  4. Log out
  5. Navigate to the link in Step 1
  6. Log in
  7. Right after the chat is loaded, return to LHN

Expected Result:

The opened chat in Step 6 will appear in LHN while the rest of the chats is loading

Actual Result:

The opened chat in Step 6 does not appear in LHN even though it is opened prior

Workaround:

Unknown

Platforms:

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

  • Android / native
  • Android / Chrome
  • iOS / native
  • iOS / Safari
  • MacOS / Chrome / Safari
  • MacOS / Desktop

Version Number: 1.3.54.7

Reproducible in staging?: Yes

Reproducible in production?: No

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

Notes/Photos/Videos: Any additional supporting documentation

Bug6165912_24204_mweb__1_.1.mp4

Expensify/Expensify Issue URL:

Issue reported by: Applause - Internal Team

Slack conversation:

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~013d3358a3bd902de6
  • Upwork Job ID: 1691926354859388928
  • Last Price Increase: 2023-08-16
  • Automatic offers:
    • s-alves10 | Contributor | 26165190
@lanitochka17 lanitochka17 added the DeployBlockerCash This issue or pull request should block deployment label Aug 15, 2023
@OSBotify
Copy link
Contributor

👋 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.

@github-actions github-actions bot added the Hourly KSv2 label Aug 15, 2023
@s-alves10
Copy link
Contributor

s-alves10 commented Aug 15, 2023

Proposal

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

Opened chat doesn't show up in LHN when LHN is loading

What is the root cause of that problem?

Please check the below code

{this.props.isLoading ? (
<>
{lodashGet(this.props.report, 'reportID') && (
<OptionRowLHNData
reportID={this.props.currentReportID}
viewMode={viewMode}
shouldDisableFocusOptions={this.props.isSmallScreenWidth}
onSelectRow={this.showReportPage}
/>
)}
<OptionsListSkeletonView shouldAnimate />
</>
) : (
<LHNOptionsList
contentContainerStyles={[styles.sidebarListContainer, {paddingBottom: StyleUtils.getSafeAreaMargins(this.props.insets).marginBottom}]}
data={this.props.optionListItems}
onSelectRow={this.showReportPage}
shouldDisableFocusOptions={this.props.isSmallScreenWidth}
optionMode={viewMode}
/>
)}

As you can see, we show skeleton when props.isLoading is true, or show report list. Before this PR, props.isLoading is false when reports are not empty, so if any report was loaded, we don't show skeleton. We show preloaded report list while loading all reports. But now, isLoading is true and this.props.report is also empty because currentReportID is undefined. So skeleton is shown full page.

image

This is the root cause

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

When we open a report and navigate to the LHN, this.props.optionListItems is not empty. We should use this

Solution 1

Replacing the this.props.isLoading condition here with the this.props.isLoading && !this.props.optionListItems.length would give the exactly same result as production

Solution 2
I think it would be good to show existing reports with skeleton while loading. In order to do this, we can use the following code

        {this.props.isLoading ? (
            <>
                <LHNOptionsList
                    style={[styles.flexShrink1]}
                    contentContainerStyles={[styles.sidebarListContainer, {paddingBottom: StyleUtils.getSafeAreaMargins(this.props.insets).marginBottom}]}
                    data={this.props.optionListItems}
                    onSelectRow={this.showReportPage}
                    shouldDisableFocusOptions={this.props.isSmallScreenWidth}
                    optionMode={viewMode}
                />
                <OptionsListSkeletonView shouldAnimate />
            </>
        ) : (
            <LHNOptionsList
                contentContainerStyles={[styles.sidebarListContainer, {paddingBottom: StyleUtils.getSafeAreaMargins(this.props.insets).marginBottom}]}
                data={this.props.optionListItems}
                onSelectRow={this.showReportPage}
                shouldDisableFocusOptions={this.props.isSmallScreenWidth}
                optionMode={viewMode}
            />
        )}

Here we need to add additional props style to the LHNOptionList component. Its default value is styles.flex1 and this code

<View style={[styles.flex1]}>

will be replaced with

    style={props.style}
Solution 1
solution_1.mp4
Solution 2
solution_2.mp4

What alternative solutions did you explore? (Optional)

@melvin-bot
Copy link

melvin-bot bot commented Aug 15, 2023

Triggered auto assignment to @grgia (Engineering), see https://stackoverflow.com/c/expensify/questions/4319 for more details.

@aldo-expensify
Copy link
Contributor

cc @tienifr @ArekChr the PR #24204 seems to have caused this regression according to @s-alves10 , can you help confirm that?

Thanks @s-alves10 for the help investigating.

@ArekChr
Copy link
Contributor

ArekChr commented Aug 16, 2023

cc @tienifr @ArekChr the PR #24204 seems to have caused this regression according to @s-alves10 , can you help confirm that?

Thanks @s-alves10 for the help investigating.

@aldo-expensify Yes, this PR caused regression

@tienifr
Copy link
Contributor

tienifr commented Aug 16, 2023

yes, it's my regression. I'll fix it asap

@yuwenmemon
Copy link
Contributor

@tienifr any ETA on when you expect to have a PR up? If it's not going to be within the next few hours then should we revert the offending PR?

@s-alves10
Copy link
Contributor

I can create a PR according to #24596 (comment) in 2~3 hours

@yuwenmemon
Copy link
Contributor

@s-alves10 great - you're hired.

@yuwenmemon yuwenmemon added the External Added to denote the issue can be worked on by a contributor label Aug 16, 2023
@melvin-bot melvin-bot bot changed the title Chat - Opened chat does not show up in LHN when LHN is loading [$1000] Chat - Opened chat does not show up in LHN when LHN is loading Aug 16, 2023
@melvin-bot
Copy link

melvin-bot bot commented Aug 16, 2023

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

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Aug 16, 2023
@melvin-bot
Copy link

melvin-bot bot commented Aug 16, 2023

Triggered auto assignment to @sakluger (External), see https://stackoverflow.com/c/expensify/questions/8582 for more details.

@melvin-bot
Copy link

melvin-bot bot commented Aug 16, 2023

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

@melvin-bot melvin-bot bot removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Aug 16, 2023
@tienifr tienifr mentioned this issue Aug 17, 2023
59 tasks
@s-alves10
Copy link
Contributor

@tienifr

I think showing all existing reports is what the previous version does. You're trying to show only one report, but this isn't a solution anyway, I think. Let me check your case

@narefyev91
Copy link
Contributor

@yuwenmemon @aldo-expensify We get in a situation where we have 2 open PR's to the same fix
PR from @tienifr already tested by @ArekChr and approved.
I can also start my part for PR from @s-alves10 - but do not want to have double work - and also based on Expected result "The opened chat in Step 6 does not appear in LHN even though it is opened prior" - i checked code from @tienifr and it fixes this issue.
And based on this comment #24596 (comment) - we will have 2 more issues - order problem and loading time
I will suggest to merge @tienifr PR and close for now @s-alves10 PR

@s-alves10
Copy link
Contributor

@narefyev91

I was already assigned to this issue and created the PR. I'm not sure why my PR should be closed.
I think this kind of situations should be handled fairly.

PS: My solution behaves the same as the old version, but I guess @tienifr 's solution tries to show only one chats. This is not expected, I think.

@ArekChr
Copy link
Contributor

ArekChr commented Aug 17, 2023

@s-alves10 Here is the original issue #23735

@s-alves10
Copy link
Contributor

The opened chat in Step 6 will appear in LHN while the rest of the chats is loading

This is the expected behavior of this issue. If we should avoid partial showing in wide-screen devices, we can add an additional condition !!this.props.currentReportID to the LHNOptionList.

I don't think this can be a reason for closing the PR
Expecting others' thoughts here

@s-alves10
Copy link
Contributor

@yuwenmemon @aldo-expensify @narefyev91

Please share your thoughts here. What should I do?

@s-alves10
Copy link
Contributor

Showing one report causes this regression as well

@aldo-expensify
Copy link
Contributor

aldo-expensify commented Aug 17, 2023

Sorry, for the delay, can we summarize what each PR is fixing and the pros and cons?

My current understanding:

@tienifr 's PR #24619 is fixing the issue reported here, right? I personally don't like much the solution using the state firstLoadedReportID... it feels like a workaround, but that doesn't mean it is not acceptable.

@s-alves10 's PR #25159 feels better to me from a code perspective, and is supposed to be fixing this issue and also the other regression. The problem is that this seem to cause some unwanted effects regarding the order of the reports in the LHN, did I get that correctly?

Would be good to know:

@aldo-expensify
Copy link
Contributor

I know I said I would come back to this later today, but I got caught in something I though would be simpler. I'll check in tomorrow!

@s-alves10
Copy link
Contributor

s-alves10 commented Aug 23, 2023

@aldo-expensify @narefyev91

I've added some updates to the PR to fix the issue mentioned here.

Please check

@narefyev91
Copy link
Contributor

@aldo-expensify after checking both PR's i think @s-alves10 PR looks preferable - we will not use state, and all logic will be inside optionListItems - which makes more sense. BTW let us know next steps here

@aldo-expensify
Copy link
Contributor

Agreed, I tested and seems to be solving both issues (commented with more details here).

Let's wait for @s-alves10 to update the PR with main and resolve conflicts, then we can do a final review.

@melvin-bot
Copy link

melvin-bot bot commented Aug 29, 2023

Based on my calculations, the pull request did not get merged within 3 working days of assignment. Please, check out my computations here:

  • when @s-alves10 got assigned: 2023-08-16 21:35:15 Z
  • when the PR got merged: 2023-08-29 17:56:11 UTC
  • days elapsed: 8

On to the next one 🚀

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels Aug 31, 2023
@melvin-bot melvin-bot bot changed the title [$1000] Chat - Opened chat does not show up in LHN when LHN is loading [HOLD for payment 2023-09-07] [$1000] Chat - Opened chat does not show up in LHN when LHN is loading Aug 31, 2023
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Aug 31, 2023
@melvin-bot
Copy link

melvin-bot bot commented Aug 31, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Aug 31, 2023

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

If no regressions arise, payment will be issued on 2023-09-07. 🎊

After the hold period is over and BZ checklist items are completed, please complete any of the applicable payments for this issue, and check them off once done.

  • External issue reporter
  • Contributor that fixed the issue
  • Contributor+ that helped on the issue and/or PR

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

As a reminder, here are the bonuses/penalties that should be applied for any External issue:

  • Merged PR within 3 business days of assignment - 50% bonus
  • Merged PR more than 9 business days after assignment - 50% penalty

@melvin-bot melvin-bot bot added the Overdue label Sep 11, 2023
@sakluger sakluger added Daily KSv2 and removed Weekly KSv2 labels Sep 12, 2023
@melvin-bot melvin-bot bot removed the Overdue label Sep 12, 2023
@sakluger
Copy link
Contributor

Summarizing payouts for this issue:

Reporter: Applause (contractor, no payment)
Contributor: @s-alves10 $1000 (hired on Upwork)
Contributor+: @narefyev91 (contractor, no payment)

Above payments include efficiency bonus 🎉
Upwork job: https://www.upwork.com/jobs/~0137e6674165abf18a

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Daily KSv2 Engineering External Added to denote the issue can be worked on by a contributor
Projects
None yet
Development

No branches or pull requests

10 participants