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-12-12] [$500] Chat - No skeleton loading when scrolling up the chat history offline until the chat is reopened #31367

Closed
6 tasks done
kbecciv opened this issue Nov 15, 2023 · 25 comments
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor

Comments

@kbecciv
Copy link

kbecciv commented Nov 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!


Version Number: 1.3.99.0
Reproducible in staging?: y
Reproducible in production?: y
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: Applause - Internal Team
Slack conversation:

Action Performed:

  1. Launch New Expensify app.
  2. Log in to HT account.
  3. Open a chat that has long chat history.
  4. Go offline.
  5. Scroll to the top.
  6. Return to LHN.
  7. Reopen the chat in Step 2 and scroll to the top.

Expected Result:

In Step 5, skeleton placeholder will appear.

Actual Result:

In Step 5, skeleton placeholder does not appear. It only appears when the chat is revisited in Step 7.

Workaround:

Unknown

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

Bug6277522_1700054825958.Screen_Recording_20231115_162131_New_Expensify__1_.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01073572ec47fdb07b
  • Upwork Job ID: 1724786009891438592
  • Last Price Increase: 2023-11-15
  • Automatic offers:
    • paultsimura | Contributor | 28015843
@kbecciv kbecciv added External Added to denote the issue can be worked on by a contributor Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Nov 15, 2023
@melvin-bot melvin-bot bot changed the title Chat - No skeleton loading when scrolling up the chat history offline until the chat is reopened [$500] Chat - No skeleton loading when scrolling up the chat history offline until the chat is reopened Nov 15, 2023
Copy link

melvin-bot bot commented Nov 15, 2023

Triggered auto assignment to @mallenexpensify (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.

Copy link

melvin-bot bot commented Nov 15, 2023

Job added to Upwork: https://www.upwork.com/jobs/~01073572ec47fdb07b

Copy link

melvin-bot bot commented Nov 15, 2023

Bug0 Triage Checklist (Main S/O)

  • This "bug" occurs on a supported platform (ensure Platforms in OP are ✅)
  • This bug is not a duplicate report (check E/App issues and #expensify-bugs)
    • If it is, comment with a link to the original report, close the issue and add any novel details to the original issue instead
  • This bug is reproducible using the reproduction steps in the OP. S/O
    • If the reproduction steps are clear and you're unable to reproduce the bug, check with the reporter and QA first, then close the issue.
    • If the reproduction steps aren't clear and you determine the correct steps, please update the OP.
  • This issue is filled out as thoroughly and clearly as possible
    • Pay special attention to the title, results, platforms where the bug occurs, and if the bug happens on staging/production.
  • I have reviewed and subscribed to the linked Slack conversation to ensure Slack/Github stay in sync

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

melvin-bot bot commented Nov 15, 2023

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

@paultsimura
Copy link
Contributor

paultsimura commented Nov 15, 2023

Proposal

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

The top report skeleton is not visible when offline.

What is the root cause of that problem?

This happens because we display the top skeleton based on this condition:

isLoadingOlderReportActions={props.isLoadingOlderReportActions}

This value should get updated by calling the Report.getOlderActions here. But we have an early return when offline. This was made to avoid endless loop of the Report.getOlderActions call.

const loadOlderChats = () => {
// Only fetch more if we are neither already fetching (so that we don't initiate duplicate requests) nor offline.
if (props.network.isOffline || props.isLoadingOlderReportActions) {
return;
}
const oldestReportAction = _.last(props.reportActions);
// Don't load more chats if we're already at the beginning of the chat history
if (oldestReportAction.actionName === CONST.REPORT.ACTIONS.TYPE.CREATED) {
return;
}
// Retrieve the next REPORT.ACTIONS.LIMIT sized page of comments
Report.getOlderActions(reportID, oldestReportAction.reportActionID);
};

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

In ReportActionsView:

First, Move (and slightly modify) this code outside of loadOlderChats to the component level:

    const oldestReportAction = _.last(props.reportActions);
    const isLoadedTillBeginning = lodashGet(oldestReportAction, 'actionName', '') === CONST.REPORT.ACTIONS.TYPE.CREATED;

Second, modify the logic for displaying the top skeleton: show it also when offline & the history is not loaded until the beginning.

    isLoadingOlderReportActions={props.isLoadingOlderReportActions || (props.network.isOffline && !isLoadedTillBeginning)}

isLoadingOlderReportActions={props.isLoadingOlderReportActions}

What alternative solutions did you explore? (Optional)

@s77rt
Copy link
Contributor

s77rt commented Nov 15, 2023

@paultsimura Thanks for the proposal. Your RCA makes sense but the solution does not look good to me. props.network.isOffline && !isLoadedTillBeginning will make isLoadingOlderReportActions evaluates to true even if we are not loading any report action.

@s77rt
Copy link
Contributor

s77rt commented Nov 15, 2023

I see this is a regression from #30658 and it's still within the regression period. In this case this should be fixed by the Contributor/Contributor+ @paultsimura / @getusha

@getusha
Copy link
Contributor

getusha commented Nov 16, 2023

I agree this looks like a regression from #30658
@paultsimura could you address @s77rt's comment and raising a PR if possible?

@paultsimura
Copy link
Contributor

Yes, I'm on it. However, @s77rt could you please elaborate a little on why is this bad?

props.network.isOffline && !isLoadedTillBeginning will make isLoadingOlderReportActions evaluates to true even if we are not loading any report action

If we are offline and not at the beginning of the conversation yet – this means we will eventually load the newer actions when online, doesn't it?
We're not loading the older actions when offline anyway, so in my understanding, the skeleton here is used only to show the user that there are some more actions to load.

@s77rt
Copy link
Contributor

s77rt commented Nov 16, 2023

@paultsimura The logic makes sense but just the way we are modifying the isLoadingOlderReportActions prop is counterintuitive. If isLoadingOlderReportActions is true then we must be indeed loading older report actions otherwise this prop won't be a reliable source of truth.

A slight adjustment is to move the logic to ListBoundaryLoader. This would keep the prop untouched and achieve same results.

@paultsimura
Copy link
Contributor

Thanks @s77rt, this makes sense.

I would like to clarify the expected UI in the offline case: should we show the long skeleton, similar to when loading the older events, or the shorter one – like when loading the initial report actions?

Short
short-.mp4
Long
long.mp4

Also, I suppose it should be not animated when offline, similar to the LoadingInitialActions skeleton:

<ReportActionsSkeletonView
shouldAnimate={!isOffline}
possibleVisibleContentItems={3}
/>

@shawnborton could you please share your upinion here?

@shawnborton
Copy link
Contributor

Hmm shorter seems to make more sense to me, but cc @Expensify/design for thoughts in case they disagree.

Also, it looks like we are missing the animation on the skeleton lines above the preview cards. Any idea why those skeleton lines are not using the pulse/fade/gradient animation?

@paultsimura
Copy link
Contributor

@shawnborton looks like it was made on purpose: we're disabling the animation when offline:

I believe this was made so that the user won't expect something new to be loaded while offline (the animation implies that something's happening).

If that's not the expected behaviour, I can remove this condition and the result will look like this:

Simulator.Screen.Recording.-.iPhone.15.-.2023-11-17.at.14.43.01.mp4

@dannymcclain
Copy link
Contributor

Oh that's interesting about the animation—it makes total sense after you explain it, but I'm not sure anyone will connect those dots on their own. I don't have strong feelings about it though so I'll leave it to @shawnborton.

I'm also a fan of the short skeleton in this situation—it does it's job communicating the state so I don't think we need any more than that.

@shawnborton
Copy link
Contributor

Hmm yeah, I see the point too. I think I'd rather just always have the subtle animation though, otherwise we get into a weird situation where we try to determine if the loading state should be animated or not based on connectivity, which might not be truly offline but could be flakey and cause some weird start/stop of the animation? So I lean towards just always having it.

@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Daily KSv2 labels Nov 17, 2023
@paultsimura
Copy link
Contributor

Thanks y'all. The PR is ready: #31492

@melvin-bot melvin-bot bot added Weekly KSv2 and removed Weekly KSv2 labels Dec 5, 2023
@melvin-bot melvin-bot bot added the Awaiting Payment Auto-added when associated PR is deployed to production label Dec 5, 2023
@melvin-bot melvin-bot bot changed the title [$500] Chat - No skeleton loading when scrolling up the chat history offline until the chat is reopened [HOLD for payment 2023-12-12] [$500] Chat - No skeleton loading when scrolling up the chat history offline until the chat is reopened Dec 5, 2023
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Dec 5, 2023
Copy link

melvin-bot bot commented Dec 5, 2023

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

Copy link

melvin-bot bot commented Dec 5, 2023

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.4.7-4 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-12-12. 🎊

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:

Copy link

melvin-bot bot commented Dec 5, 2023

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:

  • [@s77rt] The PR that introduced the bug has been identified. Link to the PR:
  • [@s77rt] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake. Link to comment:
  • [@s77rt] A discussion in #expensify-bugs has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner. Link to discussion:
  • [@s77rt] Determine if we should create a regression test for this bug.
  • [@s77rt] If we decide to create a regression test for the bug, please propose the regression test steps to ensure the same bug will not reach production again.
  • [@mallenexpensify] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:

@s77rt
Copy link
Contributor

s77rt commented Dec 5, 2023


Regression Test Proposal

  1. Open a chat that has a many messages
  2. Go offline
  3. Scroll to the top
  4. Verify that the skeleton loader is displayed

@s77rt s77rt removed their assignment Dec 5, 2023
@s77rt
Copy link
Contributor

s77rt commented Dec 5, 2023

@mallenexpensify Please assign @getusha and @paultsimura here since this is a part of #30503

@melvin-bot melvin-bot bot removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Dec 9, 2023
Copy link

melvin-bot bot commented Dec 9, 2023

❌ There was an error making the offer to @getusha for the Reviewer role. The BZ member will need to manually hire the contributor.

Copy link

melvin-bot bot commented Dec 9, 2023

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

Copy link

melvin-bot bot commented Dec 9, 2023

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

@melvin-bot melvin-bot bot added Daily KSv2 Overdue and removed Weekly KSv2 labels Dec 11, 2023
@getusha
Copy link
Contributor

getusha commented Dec 13, 2023

@mallenexpensify we can close this as it was handled as a regression.

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 Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor
Projects
None yet
Development

No branches or pull requests

7 participants