App icon indicating copy to clipboard operation
App copied to clipboard

[HOLD for payment 2024-12-17] [$250] Chat - Newline marker is shown on system message when returning back to the expense thread

Open lanitochka17 opened this issue 1 year ago β€’ 13 comments

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.66-0 Reproducible in staging?: Y Reproducible in production?: Y 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/A Email or phone of affected tester (no customers): [email protected] Issue reported by: Applause - Internal Team

Action Performed:

  1. Go to https://staging.new.expensify.com/
  2. Create an expense in workspace chat
  3. Go to report and add a category.
  4. Notice system message is create but no newline shown.
  5. Go back to the main chat and return to the report

Expected Result:

Newline marker is not shown

Actual Result:

Newline marker is shown

Workaround:

Unknown

Platforms:

Which of our officially supported platforms is this issue occurring on?

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

Screenshots/Videos

Add any screenshot/video evidence

https://github.com/user-attachments/assets/9bfee331-3303-4eae-8a95-41a29240823c

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021863726493070062798
  • Upwork Job ID: 1863726493070062798
  • Last Price Increase: 2024-12-02
Issue OwnerCurrent Issue Owner: @strepanier03

lanitochka17 avatar Nov 23 '24 13:11 lanitochka17

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

melvin-bot[bot] avatar Nov 23 '24 13:11 melvin-bot[bot]

Proposal

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

New message marker shows for update category system message.

What is the root cause of that problem?

This only happens in a one expense report. In a one expense report, when we edit the money request, the edit system message is added to the transaction thread. The one expense report shows a combined report actions between the expense report itself and the transaction thread. For showing the new message marker, we compare the unreadMarkerTime (report last read time) with the action created value. https://github.com/Expensify/App/blob/3ebe8520d74c57a2fe9548b7d4307206e2b7c673/src/pages/home/report/ReportActionsList.tsx#L278

Since editing the money request adds the action to the transaction thread, the expense report lastReadTime is unchanged and the edit system message created is bigger than the expense report lastReadTime, thus the new message line is shown.

Why this only happen after reopening the report? It's because we set the unread marker to the report lastReadTime once and then it gets updated when there is a new message, which is the edit system message in this case. https://github.com/Expensify/App/blob/3ebe8520d74c57a2fe9548b7d4307206e2b7c673/src/pages/home/report/ReportActionsList.tsx#L346-L351

But when we reopen the report, the unreadMarkerTime is set with the expense report lastReadTime.

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

We should use the transaction thread report lastReadTime if it's bigger than the expense report lastReadTime, similar to what we did to lastVisibleActionCreated. https://github.com/Expensify/App/blob/3ebe8520d74c57a2fe9548b7d4307206e2b7c673/src/pages/home/report/ReportActionsList.tsx#L358-L361

const lastReadTime =
    (transactionThreadReport?.lastReadTime ?? '') > reportLastReadTime
        ? transactionThreadReport?.lastReadTime
        : reportLastReadTime;

const [unreadMarkerTime, setUnreadMarkerTime] = useState(lastReadTime);
useEffect(() => {
    setUnreadMarkerTime(lastReadTime);

    // eslint-disable-next-line react-compiler/react-compiler, react-hooks/exhaustive-deps
}, [report.reportID]);

bernhardoj avatar Nov 24 '24 15:11 bernhardoj

@strepanier03 Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

melvin-bot[bot] avatar Nov 27 '24 09:11 melvin-bot[bot]

@strepanier03 Huh... This is 4 days overdue. Who can take care of this?

melvin-bot[bot] avatar Nov 29 '24 09:11 melvin-bot[bot]

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

melvin-bot[bot] avatar Dec 02 '24 23:12 melvin-bot[bot]

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

melvin-bot[bot] avatar Dec 02 '24 23:12 melvin-bot[bot]

Thanks, @bernhardoj 's proposal here looks good and tests well!

πŸŽ€ πŸ‘€ πŸŽ€ C+ reviewed

hungvu193 avatar Dec 04 '24 04:12 hungvu193

Triggered auto assignment to @rafecolton, see https://stackoverflow.com/c/expensify/questions/7972 for more details.

melvin-bot[bot] avatar Dec 04 '24 04:12 melvin-bot[bot]

PR is ready

cc: @hungvu193

bernhardoj avatar Dec 04 '24 14:12 bernhardoj

Requested a small change

rafecolton avatar Dec 05 '24 18:12 rafecolton

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

melvin-bot[bot] avatar Dec 10 '24 22:12 melvin-bot[bot]

The solution for this issue has been :rocket: deployed to production :rocket: in version 9.0.73-8 and is now subject to a 7-day regression period :calendar:. Here is the list of pull requests that resolve this issue:

  • https://github.com/Expensify/App/pull/53555

If no regressions arise, payment will be issued on 2024-12-17. :confetti_ball:

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

  • @hungvu193 requires payment through NewDot Manual Requests
  • @bernhardoj requires payment through NewDot Manual Requests

melvin-bot[bot] avatar Dec 10 '24 22:12 melvin-bot[bot]

@hungvu193 @strepanier03 @hungvu193 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]

melvin-bot[bot] avatar Dec 10 '24 22:12 melvin-bot[bot]

Payment Summary

Upwork Job

  • Reviewer: @hungvu193 owed $250 via NewDot
  • Reviewer: @bernhardoj owed $250 via NewDot

BugZero Checklist (@strepanier03)

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

melvin-bot[bot] avatar Dec 17 '24 09:12 melvin-bot[bot]

@hungvu193 - Can you please complete the checklist mentioned here?

strepanier03 avatar Dec 19 '24 17:12 strepanier03

BugZero Checklist:

  • [x] [Contributor] Classify the bug:
Bug classification

Source of bug:

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

Where bug was reported:

  • [x] 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
  • [x] 3d. QA
  • [ ] 3z. Other:
  • [x] [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: https://github.com/Expensify/App/pull/51174/files#r1893459180

  • [x] [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: N/A

  • [x] [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.

Regression Test Proposal

Test:

  1. Open a workspace chat with no unsettled expenses
  2. Create one new money request
  3. Open the expense report
  4. Update the money request information (any)
  5. Go back to workspace chat
  6. Open the expense report again
  7. Verify there is no new message marker

Do we agree πŸ‘ or πŸ‘Ž

hungvu193 avatar Dec 20 '24 04:12 hungvu193

@hungvu193 @bernhardoj - The payment summary is here and you're welcome to request payment.

I'll close this out now, thank you both, have a lovely new year!

strepanier03 avatar Dec 20 '24 20:12 strepanier03

Requested in ND.

bernhardoj avatar Dec 21 '24 02:12 bernhardoj

$250 approved for @bernhardoj

JmillsExpensify avatar Dec 23 '24 12:12 JmillsExpensify

$250 approved for @hungvu193

garrettmknight avatar Jan 07 '25 18:01 garrettmknight