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 2025-01-02] [$250] mWeb - Group chat - On creating group chat, chat report is shown briefly in header. #53822

Closed
1 of 8 tasks
IuliiaHerets opened this issue Dec 10, 2024 · 24 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 Engineering External Added to denote the issue can be worked on by a contributor

Comments

@IuliiaHerets
Copy link

IuliiaHerets commented Dec 10, 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: V9. 0.73-6
Reproducible in staging?: Yes
Reproducible in production?: No
If this was caught on HybridApp, is this reproducible on New Expensify Standalone?: N/A
If this was caught during regression testing, add the test name, ID and link from TestRail: N
Email or phone of affected tester (no customers): N
Issue reported by: Applause Internal Team

Action Performed:

  1. Go to https://staging.new.expensify.com/home
  2. Tap fab-- start chat
  3. Select a user and create a group chat
  4. Note the header

Expected Result:

On creating group chat, chat report must not be shown briefly in header.

Actual Result:

On creating group chat, chat report is shown briefly in header.

Workaround:

Unknown

Platforms:

  • Android: Standalone
  • Android: HybridApp
  • Android: mWeb Chrome
  • iOS: Standalone
  • iOS: HybridApp
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Bug6689794_1733818641306.Screenrecorder-2024-12-10-13-41-24-721.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021866441003573597899
  • Upwork Job ID: 1866441003573597899
  • Last Price Increase: 2024-12-10
Issue OwnerCurrent Issue Owner: @
Issue OwnerCurrent Issue Owner: @joekaufmanexpensify
@IuliiaHerets IuliiaHerets added DeployBlockerCash This issue or pull request should block deployment Bug Something is broken. Auto assigns a BugZero manager. labels Dec 10, 2024
Copy link

melvin-bot bot commented Dec 10, 2024

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.

Copy link

melvin-bot bot commented Dec 10, 2024

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

@melvin-bot melvin-bot bot added the Daily KSv2 label Dec 10, 2024
Copy link

melvin-bot bot commented Dec 10, 2024

💬 A slack conversation has been started in #expensify-open-source

@github-actions github-actions bot added Engineering Hourly KSv2 and removed Daily KSv2 labels Dec 10, 2024
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.

@IuliiaHerets
Copy link
Author

Production

Screenrecorder-2024-12-10-10-28-58-283.mp4

@jacobkim9881

This comment was marked as outdated.

@nkdengineer
Copy link
Contributor

nkdengineer commented Dec 10, 2024

Proposal

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

On creating group chat, chat report is shown briefly in header.

What is the root cause of that problem?

It comes from #53203.

We get the metadata from ReportUtils.getReportMetadata(report?.reportID), but it isn't updated in real time when we create a new report. This causes openReport to be called twice.

const reportMetadata = ReportUtils.getReportMetadata(report?.reportID);

In mWeb, for the second time openReport, reportActionsExist(reportID) still is false because allReportActions is updated after we call the second openReport. Then the report name of the group chat is changed to Chat Report and it's returned here

reportName: ReportConnection.getAllReports()?.[`${ONYXKEYS.COLLECTION.REPORT}${reportID}`]?.reportName ?? CONST.REPORT.DEFAULT_REPORT_NAME,

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

Instead of getting the reportMetadata from ReportUtils.getReportMetadata(report?.reportID), we should pass the reportMetadata from the component that uses this function.

export default function shouldFetchReport(report: OnyxEntry<Report>, reportMetadata: OnyxEntry<ReportMetadata>) {
    // If the report is optimistic, there's no need to fetch it. The original action should create it.
    // If there is an error for creating the chat, there's no need to fetch it since it doesn't exist
    return !reportMetadata?.isOptimisticReport && !report?.errorFields?.createChat;
}

const reportMetadata = ReportUtils.getReportMetadata(report?.reportID);

if (!shouldFetchReport(report, reportMetadata)) {
    return;
}

if (!shouldFetchReport(report)) {

And here if we create a new report, we should change the method of report metadata to set and move this update to the exist optimistic report meta data instead of creating a new one.

{
onyxMethod: Onyx.METHOD.MERGE,
key: `${ONYXKEYS.COLLECTION.REPORT_METADATA}${reportID}`,
value: {
isOptimisticReport: true,
},

What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?

What alternative solutions did you explore? (Optional)

Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.

@shubham1206agra
Copy link
Contributor

@cristipaval @joekaufmanexpensify Please do not mark it as external. @TMisiukiewicz Can you please raise a fix for this?

@TMisiukiewicz
Copy link
Contributor

@shubham1206agra sure, I'm on it now

@cristipaval cristipaval added Daily KSv2 Hourly KSv2 and removed Hourly KSv2 DeployBlockerCash This issue or pull request should block deployment Daily KSv2 labels Dec 10, 2024
@cristipaval
Copy link
Contributor

NAB

@cristipaval cristipaval added the External Added to denote the issue can be worked on by a contributor label Dec 10, 2024
@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Dec 10, 2024
Copy link

melvin-bot bot commented Dec 10, 2024

Current assignee @shubham1206agra is eligible for the External assigner, not assigning anyone new.

@cristipaval cristipaval removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Dec 10, 2024
@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Daily KSv2 labels Dec 10, 2024
@joekaufmanexpensify
Copy link
Contributor

PR in review

@joekaufmanexpensify
Copy link
Contributor

As an fyi, I am OOO until the new year. Please ask in slack if anything urgent BZ related comes up. Otherwise, I will handle payment when I return!

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels Dec 26, 2024
@melvin-bot melvin-bot bot changed the title [$250] mWeb - Group chat - On creating group chat, chat report is shown briefly in header. [HOLD for payment 2025-01-02] [$250] mWeb - Group chat - On creating group chat, chat report is shown briefly in header. Dec 26, 2024
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Dec 26, 2024
Copy link

melvin-bot bot commented Dec 26, 2024

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

Copy link

melvin-bot bot commented Dec 26, 2024

The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.78-6 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 2025-01-02. 🎊

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

Copy link

melvin-bot bot commented Dec 26, 2024

@shubham1206agra @joekaufmanexpensify @shubham1206agra The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]

@joekaufmanexpensify
Copy link
Contributor

OOO this week, will close this out early next week. @shubham1206agra please handle the checklist in the meantime if you can. Thanks!

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels Jan 2, 2025
Copy link

melvin-bot bot commented Jan 2, 2025

Payment Summary

Upwork Job

BugZero Checklist (@joekaufmanexpensify)

  • I have verified the correct assignees and roles are listed above and updated the neccesary manual offers
  • I have verified that there are no duplicate or incorrect contracts on Upwork for this job (https://www.upwork.com/ab/applicants/1866441003573597899/hired)
  • I have paid out the Upwork contracts or cancelled the ones that are incorrect
  • I have verified the payment summary above is correct

@joekaufmanexpensify
Copy link
Contributor

Bumped in slack

@shubham1206agra
Copy link
Contributor

BugZero Checklist:

  • [Contributor] Classify the bug:
Bug classification

Source of bug:

  • 1a. Result of the original design (eg. a case wasn't considered)
  • 1b. Mistake during implementation
  • 1c. Backend bug
  • 1z. Other:

Where bug was reported:

  • 2a. Reported on production (eg. bug slipped through the normal regression and PR testing process on staging)
  • 2b. Reported on staging (eg. found during regression or PR testing)
  • 2d. Reported on a PR
  • 2z. Other:

Who reported the bug:

  • 3a. Expensify user
  • 3b. Expensify employee
  • 3c. Contributor
  • 3d. QA
  • 3z. Other:
  • [Contributor] 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: refactor: move isOptimisticReport to reportMetadata #53203 (comment)

  • [Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source 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: Not Required

  • [Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.

  • [BugZero Assignee] Create a GH issue for creating/updating the regression test once above steps have been agreed upon.

    Link to issue:

Regression Test Proposal

Test:

Not Required as this was a deploy blocker, and is already present in Test Rail.

Do we agree 👍 or 👎

@melvin-bot melvin-bot bot added the Overdue label Jan 6, 2025
@joekaufmanexpensify
Copy link
Contributor

TY! Will handle remaining steps today.

@melvin-bot melvin-bot bot removed the Overdue label Jan 6, 2025
@joekaufmanexpensify
Copy link
Contributor

Checklist is all set.

@joekaufmanexpensify
Copy link
Contributor

@shubham1206agra I don't think any payment is required here as this was fixing a deploy blocker which originated from a PR you reviewed. Let me know if you disagree with that. Going to close this in the interim as this is otherwise all set.

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