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

[Payment Due 09/11] [$250] Expense - Missing green unread line after marking first expense as unread in expense report #45843

Closed
6 tasks done
m-natarajan opened this issue Jul 20, 2024 · 33 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 Jul 20, 2024

If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!


Version Number: 9.0.10-2
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):
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 DM.
  3. Submit two expenses to the user.
  4. Click on the expense preview to go to expense report.
  5. Right click on the first expense preview.
  6. Select Mark as unread.

Expected Result:

The line separator below "Total" will change to a green line with "New" label on the right.

Actual Result:

The line separator below "Total" disappears after marking the first expense as unread.
There is no green unread 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

Bug6547954_1721469511095.20240720_175534.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~012c73811fb416526a
  • Upwork Job ID: 1815405989806434770
  • Last Price Increase: 2024-07-29
  • Automatic offers:
    • dominictb | Contributor | 103407584
Issue OwnerCurrent Issue Owner: @sakluger
@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. DeployBlocker Indicates it should block deploying the API labels Jul 20, 2024
Copy link

melvin-bot bot commented Jul 20, 2024

Triggered auto assignment to @sakluger (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 Jul 20, 2024

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

@nyomanjyotisa
Copy link
Contributor

Proposal

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

Missing green unread line after marking first expense as unread in expense report

What is the root cause of that problem?

In this case we don't display the UnreadActionIndicator component because the shouldUseThreadDividerLine and isFirstVisibleReportAction value is both true

{shouldDisplayNewMarker && (!shouldUseThreadDividerLine || !isFirstVisibleReportAction) && <UnreadActionIndicator reportActionID={action.reportActionID} />}

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

Change this code to the following to display the UnreadActionIndicator component if only shouldDisplayNewMarker is true, since we already handled to hide the divider if the shouldHideThreadDividerLine is true. And additionally we need to pass shouldHideThreadDividerLine param to keep the space the same

{shouldDisplayNewMarker && <UnreadActionIndicator reportActionID={action.reportActionID} shouldHideThreadDividerLine={shouldHideThreadDividerLine} />}

RESULT
image

What alternative solutions did you explore? (Optional)

@Beamanator Beamanator removed the DeployBlocker Indicates it should block deploying the API label Jul 21, 2024
@Beamanator
Copy link
Contributor

@nyomanjyotisa thanks for your proposal! Can you also help us figure out what PR may have caused this bug?

@sakluger sakluger added the External Added to denote the issue can be worked on by a contributor label Jul 22, 2024
Copy link

melvin-bot bot commented Jul 22, 2024

Job added to Upwork: https://www.upwork.com/jobs/~012c73811fb416526a

@melvin-bot melvin-bot bot changed the title Expense - Missing green unread line after marking first expense as unread in expense report [$250] Expense - Missing green unread line after marking first expense as unread in expense report Jul 22, 2024
@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Jul 22, 2024
Copy link

melvin-bot bot commented Jul 22, 2024

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

@daledah
Copy link
Contributor

daledah commented Jul 22, 2024

Proposal

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

The line separator below "Total" disappears after marking the first expense as unread.
There is no green unread line.

What is the root cause of that problem?

When evaluating shouldUseThreadDividerLine, we're not taking into account the shouldHideThreadDividerLine condition here. So for the first expense, it has shouldUseThreadDividerLine true and shouldHideThreadDividerLine also true, that doesn't make sense because the divider line cannot be used and hide at the same time.

This problem causes the condition here to evaluate to false, because shouldUseThreadDividerLine is true while it shouldn't be. So the unread marker does not show.

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

Check shouldHideThreadDividerLine here too. If the shouldHideThreadDividerLine is true, the shouldHideThreadDividerLine should be false because the divider line will not be used

if (shouldHideThreadDividerLine) {
    return false;
}

Optionally, we can pass shouldHideThreadDividerLine as param to UnreadActionIndicator here, to be consistent in style with the UnreadActionIndicator here

What alternative solutions did you explore? (Optional)

I think it may not be necessary (and is quite confusing) for shouldHideThreadDividerLine and shouldUseThreadDividerLine to exist as 2 different variables, because they are opposite of each other. We can consolidate them into one by combining the checks in both here and here and use them consistently throughout.

@daledah
Copy link
Contributor

daledah commented Jul 22, 2024

I updated the proposal to add an alternative approach to solve the issue.

@dominictb
Copy link
Contributor

dominictb commented Jul 22, 2024

Proposal

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

The line separator below "Total" disappears after marking the first expense as unread.
There is no green unread line.

What is the root cause of that problem?

In MoneyReportView, we only display the divider here so when the first expense is marked as unread, shouldHideThreadDividerLine is true and then nothing displays.

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

We should use renderThreadDivider that we used here in MoneyReportView to cover the case the first expense is unread

const renderThreadDivider = useMemo(
    () =>
        shouldHideThreadDividerLine && !isCombinedReport ? (
            <UnreadActionIndicator
                reportActionID={report.reportID}
                shouldHideThreadDividerLine={shouldHideThreadDividerLine}
            />
        ) : (
            <SpacerView
                shouldShow={!shouldHideThreadDividerLine}
                style={[!shouldHideThreadDividerLine ? styles.reportHorizontalRule : {}]}
            />
        ),
    [shouldHideThreadDividerLine, report.reportID, styles.reportHorizontalRule, isCombinedReport],
);
{(shouldShowReportField || shouldShowBreakdown || shouldShowTotal) && renderThreadDivider}

What alternative solutions did you explore? (Optional)

@francoisl
Copy link
Contributor

Thanks for all the proposals so far. Can anyone identify what PR caused the regression though? It seems like all of suggested code changes aren't in code that changed recently.

@mountiny mountiny added Daily KSv2 and removed DeployBlockerCash This issue or pull request should block deployment Hourly KSv2 labels Jul 23, 2024
@mountiny
Copy link
Contributor

Demoting this because:

  • its one of last blockers
  • its edge case where user needs to mark the first IOU action as unread
  • the chat shows as unread in the LHN so the user would not miss the chat as unread

Copy link

melvin-bot bot commented Aug 3, 2024

@Beamanator @sakluger @allroundexperts this issue was created 2 weeks ago. Are we close to approving a proposal? If not, what's blocking us from getting this issue assigned? Don't hesitate to create a thread in #expensify-open-source to align faster in real time. Thanks!

@melvin-bot melvin-bot bot added the Overdue label Aug 3, 2024
@allroundexperts
Copy link
Contributor

Thanks for the proposals everyone!

@dominictb's proposal looks better to me as it utilises an already used piece of code in another component.

🎀 👀 🎀 C+ reviewed

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

melvin-bot bot commented Aug 4, 2024

Current assignee @Beamanator 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 5, 2024
Copy link

melvin-bot bot commented Aug 5, 2024

📣 @dominictb 🎉 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 6, 2024
@melvin-bot melvin-bot bot removed the Weekly KSv2 label Aug 29, 2024
Copy link

melvin-bot bot commented Aug 29, 2024

This issue has not been updated in over 15 days. @Beamanator, @sakluger, @allroundexperts, @dominictb 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!

@melvin-bot melvin-bot bot added the Monthly KSv2 label Aug 29, 2024
@dominictb
Copy link
Contributor

@Beamanator @sakluger I think this is long ready for payment

@Beamanator
Copy link
Contributor

Oof yep, this probably got merged & deployed when our automation was broken 🙃

@Beamanator Beamanator added Awaiting Payment Auto-added when associated PR is deployed to production Daily KSv2 and removed Reviewing Has a PR in review Monthly KSv2 labels Sep 25, 2024
@melvin-bot melvin-bot bot added the Overdue label Sep 25, 2024
@Beamanator Beamanator changed the title [$250] Expense - Missing green unread line after marking first expense as unread in expense report [Payment Due 09/11] [$250] Expense - Missing green unread line after marking first expense as unread in expense report Sep 25, 2024
@sakluger
Copy link
Contributor

Sorry about that!

Summarizing payment on this issue:

Contributor: @dominictb $250, paid via Upwork
Contributor+: @allroundexperts $250, please request on Newdot

@melvin-bot melvin-bot bot removed the Overdue label Sep 25, 2024
@sakluger
Copy link
Contributor

@allroundexperts do we need any new regression tests?

@sakluger
Copy link
Contributor

Pasting the BZ checklist here for convenience.

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:

[@allroundexperts] The PR that introduced the bug has been identified. Link to the PR:
[@allroundexperts] 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:
[@allroundexperts] 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:
[@allroundexperts] Determine if we should create a regression test for this bug.
[@allroundexperts] 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.

@allroundexperts
Copy link
Contributor

Checklist

  1. I wasn't able to pinpoint the exact PR that caused this issue. It seems to me that this is something that was like this when it was first implemented.
  2. N/A
  3. N/A
  4. I think a regression test would be helpful.

Regression test

  1. Open the app and go to any direct message
  2. Submit two expenses to the user
  3. Click on the expense preview to go to expense report
  4. Right click on the first expense preview
  5. Select Mark as unread.

Verify that the line separator below "Total" will change to a green line with "New" label on the right.

Do we 👍 or 👎 ?

@sakluger
Copy link
Contributor

Looks good to me. Thanks!

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: No status
Development

No branches or pull requests

9 participants