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

[$250] Self DM - Self DM header shows skeleton loading after clearing cache and restarting app #47405

Closed
5 of 6 tasks
lanitochka17 opened this issue Aug 14, 2024 · 23 comments
Closed
5 of 6 tasks
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 14, 2024

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: 9.0.20-1
Reproducible in staging?: Y
Reproducible in production?: N
If this was caught during regression testing, add the test name, ID and link from TestRail: N/A
Email or phone of affected tester (no customers): [email protected]
Issue reported by: Applause - Internal Team

Action Performed:

  1. Go to staging.new.expensify.com
  2. Go to Troubleshoot > Clear cache and restart
  3. Click Reset and restart
  4. Go to self DM

Expected Result:

The self DM header will not show skeleton loading

Actual Result:

The self DM header shows skeleton loading after clearing cache and restarting app

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

20240814_191127.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01ec9b2f42d3c8310a
  • Upwork Job ID: 1823720855143736666
  • Last Price Increase: 2024-08-21
  • Automatic offers:
    • nkdengineer | Contributor | 103625207
Issue OwnerCurrent Issue Owner: @eVoloshchak
@lanitochka17 lanitochka17 added the DeployBlockerCash This issue or pull request should block deployment label Aug 14, 2024
Copy link

melvin-bot bot commented Aug 14, 2024

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

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.

@lanitochka17
Copy link
Author

We think that this bug might be related to #vip-vsp

@carlosmiceli carlosmiceli added External Added to denote the issue can be worked on by a contributor Daily KSv2 and removed DeployBlockerCash This issue or pull request should block deployment Hourly KSv2 labels Aug 14, 2024
@melvin-bot melvin-bot bot changed the title Self DM - Self DM header shows skeleton loading after clearing cache and restarting app [$250] Self DM - Self DM header shows skeleton loading after clearing cache and restarting app Aug 14, 2024
Copy link

melvin-bot bot commented Aug 14, 2024

Job added to Upwork: https://www.upwork.com/jobs/~01ec9b2f42d3c8310a

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

melvin-bot bot commented Aug 14, 2024

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

@nkdengineer
Copy link
Contributor

Proposal

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

The self DM header shows skeleton loading after clearing cache and restarting app

What is the root cause of that problem?

After we clear cache and restarting app, the reportNameCache of the self DM becomes an empty string and then because the selfDM chat has reportNameis empty string, it returns early as an empty string here.

App/src/libs/ReportUtils.ts

Lines 3656 to 3658 in 04d0b1b

if (reportNameFromCache && reportNameFromCache.reportName === report?.reportName) {
return reportNameFromCache.reportName;
}

As expected the HeaderView display loading since the report name is an empty string

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

We should only return early if reportNameFromCache.reportName is not empty string

App/src/libs/ReportUtils.ts

Lines 3656 to 3658 in 04d0b1b

if (reportNameFromCache && reportNameFromCache.reportName === report?.reportName) {
return reportNameFromCache.reportName;
}

What alternative solutions did you explore? (Optional)

Or we should only store the cache if the value is not empty

reportNameCache.set(cacheKey, {lastVisibleActionCreated: report?.lastVisibleActionCreated ?? '', reportName: formattedName});

reportNameCache.set(cacheKey, {lastVisibleActionCreated: report?.lastVisibleActionCreated ?? '', reportName: formattedName});

@wildan-m
Copy link
Contributor

Proposal

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

The Self DM header displays skeleton loading after cache clearing and app restart.

What is the root cause of that problem?

personalDetails is not re-loaded yet after the cache and selfDM doesn't have displayName value

personalDetails will contain this value

{
    "isOptimisticPersonalDetail": true
}

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

If it's self DM, use currentUserEmail as fallback when personalDetails is not loaded. Replace this code to:

    // For selfDM, we display the user's displayName followed by '(you)' as a postfix
    const isSelfDM = accountID === currentUserAccountID;
    const shouldAddPostfix = shouldAddCurrentUserPostfix && isSelfDM;

    // This is to check if account is an invite/optimistically created one
    // and prevent from falling back to 'Hidden', so a correct value is shown
    // when searching for a new user
    if (personalDetails.isOptimisticPersonalDetail === true) {
        return !isEmpty(formattedLogin) ? formattedLogin : (isSelfDM ? PersonalDetailsUtils.getDisplayNameOrDefault(personalDetails, currentUserEmail, shouldFallbackToHidden, shouldAddPostfix) : '');
    }

What alternative solutions did you explore? (Optional)

N/A

Copy link

melvin-bot bot commented Aug 19, 2024

@carlosmiceli, @eVoloshchak Huh... This is 4 days overdue. Who can take care of this?

@melvin-bot melvin-bot bot added the Overdue label Aug 19, 2024
@carlosmiceli
Copy link
Contributor

Have you had a chance to look at the proposals @eVoloshchak ?

Copy link

melvin-bot bot commented Aug 21, 2024

📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸

Copy link

melvin-bot bot commented Aug 21, 2024

@carlosmiceli, @eVoloshchak 6 days overdue. This is scarier than being forced to listen to Vogon poetry!

@eVoloshchak
Copy link
Contributor

We should only return early if reportNameFromCache.reportName is not empty string

@nkdengineer's proposal looks good to me, a simple and universal solution

🎀👀🎀 C+ reviewed!

@melvin-bot melvin-bot bot removed the Overdue label Aug 21, 2024
Copy link

melvin-bot bot commented Aug 21, 2024

Current assignee @carlosmiceli is eligible for the choreEngineerContributorManagement assigner, not assigning anyone new.

@melvin-bot melvin-bot bot removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Aug 21, 2024
Copy link

melvin-bot bot commented Aug 21, 2024

📣 @nkdengineer 🎉 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 Reviewing Has a PR in review Weekly KSv2 and removed Daily KSv2 labels Aug 22, 2024
@melvin-bot melvin-bot bot added Monthly KSv2 and removed Weekly KSv2 labels Sep 16, 2024
Copy link

melvin-bot bot commented Sep 16, 2024

This issue has not been updated in over 15 days. @carlosmiceli, @eVoloshchak, @nkdengineer 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!

@carlosmiceli
Copy link
Contributor

@eVoloshchak this was fixed by your other PR, right? We can close this?

@eVoloshchak
Copy link
Contributor

@carlosmiceli, no, this was resolved by #47831 ( the original PR for this issue)
Not sure why the automation has failed, it was deployed to production 3 weeks ago. Posting a checklist below

@eVoloshchak
Copy link
Contributor

  • The PR that introduced the bug has been identified. Link to the PR: Add cache to getReportName #47156
  • 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: https://github.com/Expensify/App/pull/47156/files#r1766911979
  • 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: This is a simple issue, I don't think an additional discussion is needed

Regression Test Proposal

  1. Go to Troubleshoot > Clear cache and restart
  2. Click Reset and restart
  3. Go to self DM
  4. Verify that the self DM header is displayed correctly

Do we agree 👍 or 👎

@carlosmiceli
Copy link
Contributor

Yeah, that sounds good, thanks!

@eVoloshchak
Copy link
Contributor

@carlosmiceli, could you post a payment summary for this please?

@carlosmiceli
Copy link
Contributor

carlosmiceli commented Sep 19, 2024

Ah, let me ask @mallenexpensify for what to do here exactly, first time seeing this situation. Matt, can we use this as a teaching moment (for me) as well as wrapping this up with @eVoloshchak ? Thanks! 🙏

@mallenexpensify mallenexpensify self-assigned this Sep 19, 2024
@mallenexpensify mallenexpensify added Daily KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Reviewing Has a PR in review Monthly KSv2 labels Sep 19, 2024
@mallenexpensify
Copy link
Contributor

Contributor: @nkdengineer paid $250 via Upwork
Contributor+: @eVoloshchak due $250 via NewDot

Testrail GH

@carlosmiceli , the step for you would be to add Bug or New Feature to assign a BZ to manage!

@JmillsExpensify
Copy link

$250 approved for @eVoloshchak

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

7 participants