You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Awaiting checklist] [$250] mWeb - Chat - Chat not autoscrolled when categorized expense is sent to chat with content. #54001
Version Number: 9.0.75-0 Reproducible in staging?: Yes Reproducible in production?: Yes If this was caught during regression testing, add the test name, ID and link from TestRail:#52221 Email or phone of affected tester (no customers):ibellicotest+91@gmail.com Issue reported by: Applause Internal Team Device used: Motorola MotoG60 - Android 12 App Component: Money Requests
Action Performed:
Precondition: Workspace to submit categorized expense, must have an expense on it.
Open the staging.new.expensify.com
Open self DM and tap on the "+" button
Select "Track Expense" and complete the creation flow.
Once naviagted to chat again, tap on "Categorize it"
Select any category.
Add a merchant.
Submit the expense to a workspace that already has an expense or content on it.
Expected Result:
When categorizing an expense and submitting it to a workspace that already has content in it, the chat should be autoscrolled.
Actual Result:
Chat is not autoscrolled after categorizing an expense and submitting it to a workspace chat that already has an expense or content in it.
Please re-state the problem that we are trying to solve in this issue.
The categorized track expense isn't shown fully because the chat isn't auto scrolled to the bottom.
What is the root cause of that problem?
This only happens with WS track expense. This issue happens when the report last action created value doesn't match the report lastVisibleActionCreated.
Also, if we do a track expense directly on the WS (without going through Categorize flow), then it works fine even though we don't update the lastVisibleActionCreated. That's because we trigger notifyNewAction which will scroll the chat to the bottom.
What changes do you think we should make in order to solve the problem?
I don't like mutating the object and instead of using notifyNewAction, it's better to fix the root cause of the lastVisibleActionCreated optimistic data. So, to fix this, we can update the lastVisibleActionCreated to the report preview action if we are creating a new report preview.
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
We can create a test for buildOnyxDataForTrackExpense and test the optimistic data of the chat report when shouldCreateNewMoneyRequestReport is true and false.
changed the title [-]mWeb - Chat - Chat not autoscrolled when categorized expense is sent to chat with content.[/-][+][$250] mWeb - Chat - Chat not autoscrolled when categorized expense is sent to chat with content.[/+]on Dec 12, 2024
changed the title [-][Due for payment 2025-02-18] [$250] mWeb - Chat - Chat not autoscrolled when categorized expense is sent to chat with content.[/-][+][Awaiting checklist] [$250] mWeb - Chat - Chat not autoscrolled when categorized expense is sent to chat with content.[/+]on Feb 18, 2025
[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.
Activity
melvin-bot commentedon Dec 12, 2024
Triggered auto assignment to @twisterdotcom (
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.bernhardoj commentedon Dec 12, 2024
Proposal
Please re-state the problem that we are trying to solve in this issue.
The categorized track expense isn't shown fully because the chat isn't auto scrolled to the bottom.
What is the root cause of that problem?
This only happens with WS track expense. This issue happens when the report last action
createdvalue doesn't match the reportlastVisibleActionCreated.App/src/pages/home/report/ReportActionsView.tsx
Lines 301 to 302 in 50c1db8
App/src/pages/home/report/ReportActionsView.tsx
Line 485 in 50c1db8
When we create a track expense, including categorizing it, we don't update the
lastVisibleActionCreatedat all.App/src/libs/actions/IOU.ts
Lines 1507 to 1514 in 50c1db8
This doesn't happen to, money requests, for example. If we see here, we don't set the
lastVisibleActionCreatedtoo for the money request.App/src/libs/actions/IOU.ts
Lines 696 to 702 in 50c1db8
But we actually mutate the chat report
lastVisibleActionCreatedhere when a new report preview is created.App/src/libs/actions/IOU.ts
Lines 2339 to 2343 in 50c1db8
Also, if we do a track expense directly on the WS (without going through Categorize flow), then it works fine even though we don't update the
lastVisibleActionCreated. That's because we triggernotifyNewActionwhich will scroll the chat to the bottom.App/src/libs/actions/IOU.ts
Line 4119 in 50c1db8
What changes do you think we should make in order to solve the problem?
I don't like mutating the object and instead of using
notifyNewAction, it's better to fix the root cause of thelastVisibleActionCreatedoptimistic data. So, to fix this, we can update thelastVisibleActionCreatedto the report preview action if we are creating a new report preview.App/src/libs/actions/IOU.ts
Lines 1515 to 1523 in 8ed48d2
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
We can create a test for
buildOnyxDataForTrackExpenseand test the optimistic data of the chat report whenshouldCreateNewMoneyRequestReportis true and false.[-]mWeb - Chat - Chat not autoscrolled when categorized expense is sent to chat with content.[/-][+][$250] mWeb - Chat - Chat not autoscrolled when categorized expense is sent to chat with content.[/+]melvin-bot commentedon Dec 12, 2024
Job added to Upwork: https://www.upwork.com/jobs/~021867328605330762929
melvin-bot commentedon Dec 12, 2024
Triggered auto assignment to Contributor-plus team member for initial proposal review - @shubham1206agra (
External)melvin-bot commentedon Dec 16, 2024
@twisterdotcom, @shubham1206agra Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!
twisterdotcom commentedon Dec 18, 2024
Still
Help Wantedmelvin-bot commentedon Dec 18, 2024
@twisterdotcom, @shubham1206agra Eep! 4 days overdue now. Issues have feelings too...
42 remaining items
twisterdotcom commentedon Feb 18, 2025
Payment Summary:
[-][Due for payment 2025-02-18] [$250] mWeb - Chat - Chat not autoscrolled when categorized expense is sent to chat with content.[/-][+][Awaiting checklist] [$250] mWeb - Chat - Chat not autoscrolled when categorized expense is sent to chat with content.[/+]bernhardoj commentedon Feb 18, 2025
Requested in ND.
JmillsExpensify commentedon Feb 19, 2025
$250 approved for @bernhardoj
melvin-bot commentedon Feb 21, 2025
@twisterdotcom, @srikarparsi, @bernhardoj, @shubham1206agra Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!
shubham1206agra commentedon Feb 22, 2025
BugZero Checklist:
Bug classification
Source of bug:
Where bug was reported:
Who reported the bug:
[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/36934/files#r1966458419
[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: https://github.com/Expensify/Expensify/issues/473689
Regression Test Proposal
Test:
Do we agree 👍 or 👎
twisterdotcom commentedon Feb 24, 2025
Please accept the Upwork offer now @shubham1206agra.