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 2024-05-09] [$250] Send invoice - Thread header in invoice workspace chat shows third line "Invoice" #41289

Closed
6 tasks done
m-natarajan opened this issue Apr 30, 2024 · 21 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

@m-natarajan
Copy link

m-natarajan commented Apr 30, 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: 1.4.68-0
Reproducible in staging?: Yes
Reproducible in production?: No (New Feature)
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. Go to staging.new.expensify.com
  2. Go to workspace chat.
  3. Send a message.
  4. Right click on the message > Reply in thread.
  5. Note that the header consists of two lines.
  6. Go to FAB > Send invoice.
  7. Send an invoice.
  8. In invoice workspace chat, send a message.
  9. Right click on the message > Reply in thread.

Expected Result:

Only two lines will be shown in the thread header, which will be header and subtitle link.

Actual Result:

Three lines are shown in invoice workspace chat thread header, which are made of header, subtitle link and "Invoice" line.

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

Bug6466136_1714443495921.bandicam_2024-04-30_10-14-23-466.mp4

Add any screenshot/video evidence

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~0151a2dd35ff38b79a
  • Upwork Job ID: 1785187433647714304
  • Last Price Increase: 2024-04-30
Issue OwnerCurrent Issue Owner: @alexpensify
@m-natarajan m-natarajan added DeployBlockerCash This issue or pull request should block deployment Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Apr 30, 2024
Copy link

melvin-bot bot commented Apr 30, 2024

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

Copy link

melvin-bot bot commented Apr 30, 2024

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

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

@m-natarajan
Copy link
Author

We think this bug might be related to #wave-collect - Release 1

@m-natarajan
Copy link
Author

@robertjchen FYI I haven't added the External label as I wasn't 100% sure about this issue. Please take a look and add the label if you agree it's a bug and can be handled by external contributors.

@Nodebrute
Copy link
Contributor

Nodebrute commented Apr 30, 2024

Proposal

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

Thread header in invoice workspace chat shows third line "Invoice"

What is the root cause of that problem?

That's because we check for isChatThread after isInvoiceRoom.

App/src/libs/ReportUtils.ts

Lines 3164 to 3169 in a462d58

if (isInvoiceRoom(report)) {
return Localize.translateLocal('workspace.common.invoices');
}
if (isChatThread(report)) {
return '';
}

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

We should swap positions of these two checks.

App/src/libs/ReportUtils.ts

Lines 3164 to 3169 in a462d58

if (isInvoiceRoom(report)) {
return Localize.translateLocal('workspace.common.invoices');
}
if (isChatThread(report)) {
return '';
}

 if (isChatThread(report)) {
        return '';
    }
    if (isInvoiceRoom(report)) {
        return Localize.translateLocal('workspace.common.invoices');
    }

What alternative solutions did you explore? (Optional)

This check is used twice in the same function. We can eliminate the first instance.

App/src/libs/ReportUtils.ts

Lines 873 to 875 in a462d58

function isInvoiceRoom(report: OnyxEntry<Report>): boolean {
return getChatType(report) === CONST.REPORT.CHAT_TYPE.INVOICE;
}

We also check for isInvoiceRoom here, so it's safe to remove the above block.

App/src/libs/ReportUtils.ts

Lines 3186 to 3188 in a462d58

if (isInvoiceRoom(report)) {
return Localize.translateLocal('workspace.common.invoices');
}

Solution 3
Add a check to see if it's a chat thread. If it is, this function should return false.

App/src/libs/ReportUtils.ts

Lines 873 to 875 in a462d58

function isInvoiceRoom(report: OnyxEntry<Report>): boolean {
return getChatType(report) === CONST.REPORT.CHAT_TYPE.INVOICE;
}

@robertjchen
Copy link
Contributor

Does not appear to be a serious deploy blocker to me and should be addressable by external contributors 👍

@robertjchen robertjchen 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 Apr 30, 2024
Copy link

melvin-bot bot commented Apr 30, 2024

Job added to Upwork: https://www.upwork.com/jobs/~0151a2dd35ff38b79a

@melvin-bot melvin-bot bot changed the title Send invoice - Thread header in invoice workspace chat shows third line "Invoice" [$250] Send invoice - Thread header in invoice workspace chat shows third line "Invoice" Apr 30, 2024
@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Apr 30, 2024
Copy link

melvin-bot bot commented Apr 30, 2024

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

@neonbhai
Copy link
Contributor

Proposal

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

Thread header in invoice workspace chat shows third line "Invoice"

What is the root cause of that problem?

We never show subtitle for chat threads in app, but don't check for it here:

const shouldShowSubtitle = () => {
if (!subtitle) {
return false;
}

The issue is apparent when the order of checks in getChatRoom changed. This makes it easy to introduce regressions to header in the future as we don't have clear enough rule as what should be the order of the checks.

App/src/libs/ReportUtils.ts

Lines 3163 to 3169 in aee3a53

function getChatRoomSubtitle(report: OnyxEntry<Report>): string | undefined {
if (isInvoiceRoom(report)) {
return Localize.translateLocal('workspace.common.invoices');
}
if (isChatThread(report)) {
return '';
}

To make sure we don't accidently display subtitles in future (even if a subtitle is calculated) in the context of a thread, we would add sanity checks here:

const shouldShowSubtitle = () => {
if (!subtitle) {
return false;
}

This would make the display logic clear and independent of arbitrary ordered if conditions here.

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

We would:

  • Keep the isChatThread as the first check in getChatRoomSubtitle :
    function getChatRoomSubtitle(report: OnyxEntry<Report>): string | undefined {
  • We will add a check for !isChatThead in shouldShowSubtitle here
    const shouldShowSubtitle = () => {
    if(isChatThead) {
        return false
    }

Result

This works perfectly:

Screen.Recording.2024-04-30.at.3.05.57.PM.mov

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

#vip-billpay related. cc @danielrvidal

@VickyStash
Copy link
Contributor

Hi, I'm Viktoryia from Callstack - expert contributor group - and I would like to work on this issue.

@VickyStash
Copy link
Contributor

The issue should be fixed with this PR: #41316

@Nodebrute
Copy link
Contributor

@cristipaval Hi, I submitted my proposal after the 'help wanted' tag was added. As far as I know, proposals submitted before the Callstack contributor's comment are considered.

@VickyStash
Copy link
Contributor

NOTE: I'll be OOO 1-8th of May 🌴

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Daily KSv2 labels May 2, 2024
@melvin-bot melvin-bot bot changed the title [$250] Send invoice - Thread header in invoice workspace chat shows third line "Invoice" [HOLD for payment 2024-05-09] [$250] Send invoice - Thread header in invoice workspace chat shows third line "Invoice" May 2, 2024
Copy link

melvin-bot bot commented May 2, 2024

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.4.69-2 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 2024-05-09. 🎊

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

Copy link

melvin-bot bot commented May 2, 2024

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:

  • [@rushatgabhane] The PR that introduced the bug has been identified. Link to the PR:
  • [@rushatgabhane] 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:
  • [@rushatgabhane] 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:
  • [@rushatgabhane] Determine if we should create a regression test for this bug.
  • [@rushatgabhane] 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.
  • [@alexpensify] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels May 8, 2024
@alexpensify
Copy link
Contributor

alexpensify commented May 8, 2024

Tomorrow, I'll prepare the payment summary if one isn't auto-created for this GitHub.

Copy link

melvin-bot bot commented May 9, 2024

Payment Summary

Upwork Job

BugZero Checklist (@alexpensify)

  • 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/1785187433647714304/hired)
  • I have paid out the Upwork contracts or cancelled the ones that are incorrect
  • I have verified the payment summary above is correct

@alexpensify
Copy link
Contributor

Closing - the automation is correct here. @rushatgabhane please submit the payment request. Thanks!

@github-project-automation github-project-automation bot moved this from Medium to Done in [#whatsnext] #billpay May 9, 2024
@JmillsExpensify
Copy link

$250 approved for @rushatgabhane

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
Status: Done
Development

No branches or pull requests

10 participants