[HOLD for payment 2024-12-17] [$250] Chat - Newline marker is shown on system message when returning back to the expense thread
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:
- Go to https://staging.new.expensify.com/
- Create an expense in workspace chat
- Go to report and add a category.
- Notice system message is create but no newline shown.
- 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
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 Owner
Current Issue Owner: @strepanier03
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.
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]);
@strepanier03 Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!
@strepanier03 Huh... This is 4 days overdue. Who can take care of this?
Job added to Upwork: https://www.upwork.com/jobs/~021863726493070062798
Triggered auto assignment to Contributor-plus team member for initial proposal review - @hungvu193 (External)
Triggered auto assignment to @rafecolton, see https://stackoverflow.com/c/expensify/questions/7972 for more details.
PR is ready
cc: @hungvu193
Requested a small change
Reviewing label has been removed, please complete the "BugZero Checklist".
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
@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]
Payment Summary
- 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
@hungvu193 - Can you please complete the checklist mentioned here?
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:
- Open a workspace chat with no unsettled expenses
- Create one new money request
- Open the expense report
- Update the money request information (any)
- Go back to workspace chat
- Open the expense report again
- Verify there is no new message marker
Do we agree π or π
@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!
Requested in ND.
$250 approved for @bernhardoj
$250 approved for @hungvu193