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
[HOLD for payment 2023-09-29] [$500] Report - Conversation history does not scroll down after sending a message and IOU #26432
Preconditions:
Log in using a HIGH traffic account.
Open New Expensify app
Navigate to a chat that has a very long history
Scroll up the conversation history
Send any message or IOU
Expected Result:
When you send a message or IOU in a conversation, the message history should scroll down without artifacts to the newly sent message or IOU
Actual Result:
When sending a message or IOU in a conversation, the message history doesn't scroll down, and on Native apps the conversation history starts scrolling chaotically up to down
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Android / native
Android / Chrome
iOS / native
iOS / Safari
MacOS / Chrome / Safari
MacOS / Desktop
Version Number: 1.3.60-1
Reproducible in staging?: Yes
Reproducible in production?: Yes
If this was caught during regression testing, add the test name, ID and link from TestRail:
Please re-state the problem that we are trying to solve in this issue.
When a new message is sent by the current user, the app does not automatically scroll to the bottom.
What is the root cause of that problem?
The bug was introduced by this PR #18637. In this PR, this scrolling logic was removed from the ReportActionsView component while migrating the Unread Marker logic from ReportActionsView to ReportActionsList component.
The behavior before this PR was:
in the previous commit (before that PR), If a new message is sent and it's from the current user the app scroll to the bottom:
// If a new comment is added and it's from the current user scroll to the bottom otherwise leave the user positioned where
// they are now in the list.
if(isFromCurrentUser){
scrollToBottom();
What changes do you think we should make in order to solve the problem?
Integrate the subscribeToNewActionEvent call within the ReportActionsList component, coinciding with the migrated unread marker logic:
// In the component we are subscribing to the arrival of new actions.// As there is the possibility that there are multiple instances of a ReportScreen// for the same report, we only ever want one subscription to be active, as// the subscriptions could otherwise be conflicting.constnewActionUnsubscribeMap={};
useEffect(()=>{// Why are we doing this, when in the cleanup of the useEffect we are already calling the unsubscribe function?// Answer: On web, when navigating to another report screen, the previous report screen doesn't get unmounted,// meaning that the cleanup might not get called. When we then open a report we had open already previosuly, a new// ReportScreen will get created. Thus, we have to cancel the earlier subscription of the previous screen,// because the two subscriptions could conflict!// In case we return to the previous screen (e.g. by web back navigation) the useEffect for that screen would// fire again, as the focus has changed and will set up the subscription correctly again.constpreviousSubUnsubscribe=newActionUnsubscribeMap[report.reportID];if(previousSubUnsubscribe){previousSubUnsubscribe();}// This callback is triggered when a new action arrives via Pusher and the event is emitted from Report.js. This allows us to maintain// a single source of truth for the "new action" event instead of trying to derive that a new action has appeared from looking at props.constunsubscribe=Report.subscribeToNewActionEvent(report.reportID,(isFromCurrentUser)=>{// If a new comment is added and it's from the current user scroll to the bottom otherwise leave the user positioned where// they are now in the list.if(!isFromCurrentUser)return;reportScrollManager.scrollToBottom();});constcleanup=()=>{if(unsubscribe){unsubscribe();}Report.unsubscribeFromReportChannel(report.reportID);};newActionUnsubscribeMap[report.reportID]=cleanup;return()=>{cleanup();};},[report.reportID,reportScrollManager]);
// In the component we are subscribing to the arrival of new actions.// As there is the possibility that there are multiple instances of a ReportScreen// for the same report, we only ever want one subscription to be active, as// the subscriptions could otherwise be conflicting.constnewActionUnsubscribeMap={};
useEffect(()=>{// Why are we doing this, when in the cleanup of the useEffect we are already calling the unsubscribe function?// Answer: On web, when navigating to another report screen, the previous report screen doesn't get unmounted,// meaning that the cleanup might not get called. When we then open a report we had open already previosuly, a new// ReportScreen will get created. Thus, we have to cancel the earlier subscription of the previous screen,// because the two subscriptions could conflict!// In case we return to the previous screen (e.g. by web back navigation) the useEffect for that screen would// fire again, as the focus has changed and will set up the subscription correctly again.constpreviousSubUnsubscribe=newActionUnsubscribeMap[reportID];if(previousSubUnsubscribe){previousSubUnsubscribe();}// This callback is triggered when a new action arrives via Pusher and the event is emitted from Report.js. This allows us to maintain// a single source of truth for the "new action" event instead of trying to derive that a new action has appeared from looking at props.constunsubscribe=Report.subscribeToNewActionEvent(reportID,(isFromCurrentUser)=>{// If a new comment is added and it's from the current user scroll to the bottom otherwise leave the user positioned where// they are now in the list.if(!isFromCurrentUser)return;reportScrollManager.scrollToBottom();});constcleanup=()=>{if(unsubscribe){unsubscribe();}Report.unsubscribeFromReportChannel(reportID);};newActionUnsubscribeMap[reportID]=cleanup;return()=>{cleanup();};},[reportID,reportScrollManager]);
Alternative 2:
We could potentially examine the sortedReportActions prop of ReportActionsList inferring the arrival of a new action solely based on prop changes as an alternative to the listener.
changed the title [-] Report - Conversation history does not scroll down after sending a message and IOU[/-][+][$500] Report - Conversation history does not scroll down after sending a message and IOU[/+]on Sep 1, 2023
the PR was approved by C+ within 2 days of assignment, and it was waiting for only the Engineer's approval & merge (+2 days after C+ approved), and in this stage it exceeds the 3 days rule, and the engineer had no major requested changes to the PR once they reviewed. is this issue eligible for urgency bonus?
@mollfpr can you please confirm if you'd prefer to be paid via Upwork or NewDot? You've already accepted the Upwork contract, so if you'd like to be paid via NewDot I'd have to cancel that.
Also, can you please complete the BZ checklist? Thanks!
[@mollfpr] 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:
[@mollfpr] 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:
I don't think we can have a checklist to prevent this. The regression step should be good.
[@mollfpr] Determine if we should create a regression test for this bug.
[@mollfpr] 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.
Open the app
Navigate to a chat that has a long history
Scroll up the conversation history
Send any message or IOU
Verify that the conversation history automatically scrolls down to the new message.
Activity
melvin-bot commentedon Aug 31, 2023
Triggered auto assignment to @sakluger (
Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.melvin-bot commentedon Aug 31, 2023
Bug0 Triage Checklist (Main S/O)
Platformsin OP are ✅)rayane-d commentedon Aug 31, 2023
@lanitochka17, I reported the same bug 10 days ago. You can find the details here: https://expensify.slack.com/archives/C049HHMV9SM/p1692633002201879. could you credit my name when addressing this? Thank you
rayane-d commentedon Sep 1, 2023
Proposal
Please re-state the problem that we are trying to solve in this issue.
When a new message is sent by the current user, the app does not automatically scroll to the bottom.
What is the root cause of that problem?
The bug was introduced by this PR #18637. In this PR, this scrolling logic was removed from the
ReportActionsViewcomponent while migrating theUnread Markerlogic fromReportActionsViewtoReportActionsListcomponent.The behavior before this PR was:
in the previous commit (before that PR), If a new message is sent and it's from the current user the app scroll to the bottom:
App/src/pages/home/report/ReportActionsView.js
Lines 155 to 161 in 8cd29e6
What changes do you think we should make in order to solve the problem?
Integrate the
subscribeToNewActionEventcall within the ReportActionsList component, coinciding with the migrated unread marker logic:Result:
31.New.Expensify.Mozilla.Firefox.2023-09-01.01-39-29.mp4
What alternative solutions did you explore? (Optional)
Alternative 1:
Reintegrate the
subscribeToNewActionEventcall within the ReportActionsView component:Alternative 2:
We could potentially examine the sortedReportActions prop of ReportActionsList inferring the arrival of a new action solely based on prop changes as an alternative to the listener.
[-] Report - Conversation history does not scroll down after sending a message and IOU[/-][+][$500] Report - Conversation history does not scroll down after sending a message and IOU[/+]melvin-bot commentedon Sep 1, 2023
Job added to Upwork: https://www.upwork.com/jobs/~016b9e851c8568700f
melvin-bot commentedon Sep 1, 2023
Current assignee @sakluger is eligible for the External assigner, not assigning anyone new.
melvin-bot commentedon Sep 1, 2023
Triggered auto assignment to Contributor-plus team member for initial proposal review - @mollfpr (
External)rayane-d commentedon Sep 3, 2023
@mollfpr, could you please review my proposal when you get a chance? Thank you!
47 remaining items
melvin-bot commentedon Oct 2, 2023
@sakluger, @mollfpr, @thienlnam, @rayane-djouah Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!
rayane-d commentedon Oct 2, 2023
the PR was approved by C+ within 2 days of assignment, and it was waiting for only the Engineer's approval & merge (+2 days after C+ approved), and in this stage it exceeds the 3 days rule, and the engineer had no major requested changes to the PR once they reviewed. is this issue eligible for urgency bonus?
sakluger commentedon Oct 2, 2023
Yes, I reviewed the PR timeline and this one qualifies for the efficiency bonus. I'm going through and writing up payments now.
sakluger commentedon Oct 2, 2023
Summarizing payouts for this issue:
Bug reporter: @rayane-djouah $50 (paid via Upwork)
Contributor: @rayane-djouah $750 (paid via Upwork)
Contributor+: @mollfpr $750 (need to confirm preferred payment method)
Above payments include efficiency bonus 🎉
Upwork job: https://www.upwork.com/jobs/~016b9e851c8568700f
sakluger commentedon Oct 2, 2023
@mollfpr can you please confirm if you'd prefer to be paid via Upwork or NewDot? You've already accepted the Upwork contract, so if you'd like to be paid via NewDot I'd have to cancel that.
Also, can you please complete the BZ checklist? Thanks!
mollfpr commentedon Oct 3, 2023
@sakluger I think from Upwork is okay since we already have the contract.
Completing the checklist now.
mollfpr commentedon Oct 3, 2023
#18637
https://github.com/Expensify/App/pull/18637/files#r1318079323
I don't think we can have a checklist to prevent this. The regression step should be good.
sakluger commentedon Oct 4, 2023
Thanks! Just sent the payment through Upwork @mollfpr.
Regression test steps look good, thanks!
izarutskaya commentedon Nov 7, 2023
Issue reproducible on latest build - v1.3.96-0
Android / native
Screen_Recording_20231107_235340_New.Expensify.mp4
rayane-d commentedon Nov 7, 2023
@izarutskaya I think we should create a new issue for this instead of reopening this issue
thienlnam commentedon Nov 8, 2023
We're handling in here #30947