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

[Due for payment 2025-02-19] [$250] Android - Chat - Chat is not autoscrolled when sending new message after opened from search. #52878

Closed
2 of 8 tasks
izarutskaya opened this issue Nov 21, 2024 · 74 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 External Added to denote the issue can be worked on by a contributor

Comments

@izarutskaya
Copy link

izarutskaya commented Nov 21, 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.65-0
Reproducible in staging?: Y
Reproducible in production?: Y
If this was caught on HybridApp, is this reproducible on New Expensify Standalone?: Y
If this was caught during regression testing, add the test name, ID and link from TestRail: https://expensify.testrail.io/index.php?/tests/view/5251120&group_by=cases:section_id&group_order=asc&group_id=296775
Logs: https://stackoverflow.com/c/expensify/questions/4856
Issue reported by: Applause-Internal team

Action Performed:

  1. Open the Expensify app.
  2. Tap on "Search" on the bottom of the screen.
  3. Tap on the dropdown menu and select "Chats"
  4. Tap on the message displayed on the top.
  5. Verify the correct chat is displayed and the message is highlighted.
  6. Write a new message and send it to chat,
  7. Verify that chat is autoscrolled to the bottom.

Expected Result:

Chat should be autoscrolled to the bottom after opening message from search and sending a new one.

Actual Result:

Chat is not autoscrolled to the bottom after being opened from the "Chats" section in search and sending a new message to it.

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
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Bug6671541_1732171036624.Not_Scrolled.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021861164052049967286
  • Upwork Job ID: 1861164052049967286
  • Last Price Increase: 2025-02-03
  • Automatic offers:
    • wildan-m | Contributor | 105979385
Issue OwnerCurrent Issue Owner: @johncschuster
@izarutskaya izarutskaya added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Nov 21, 2024
Copy link

melvin-bot bot commented Nov 21, 2024

Triggered auto assignment to @johncschuster (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 Nov 25, 2024

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

@johncschuster johncschuster added the External Added to denote the issue can be worked on by a contributor label Nov 25, 2024
@melvin-bot melvin-bot bot changed the title Android - Chat - Chat is not autoscrolled when sending new message after opened from search. [$250] Android - Chat - Chat is not autoscrolled when sending new message after opened from search. Nov 25, 2024
Copy link

melvin-bot bot commented Nov 25, 2024

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

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Nov 25, 2024
Copy link

melvin-bot bot commented Nov 25, 2024

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

@melvin-bot melvin-bot bot removed the Overdue label Nov 25, 2024
Copy link

melvin-bot bot commented Nov 29, 2024

@johncschuster, @rayane-djouah Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

@melvin-bot melvin-bot bot added the Overdue label Nov 29, 2024
@rayane-d
Copy link
Contributor

Waiting on proposals

@melvin-bot melvin-bot bot removed the Overdue label Nov 29, 2024
Copy link

melvin-bot bot commented Dec 2, 2024

📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸

@melvin-bot melvin-bot bot added the Overdue label Dec 2, 2024
@rayane-d
Copy link
Contributor

rayane-d commented Dec 2, 2024

Waiting on proposals

@melvin-bot melvin-bot bot removed the Overdue label Dec 2, 2024
@muttmuure muttmuure moved this to Bugs and Follow Up Issues in [#whatsnext] #expense Dec 3, 2024
@QichenZhu
Copy link
Contributor

QichenZhu commented Dec 3, 2024

Edited by proposal-police: This proposal was edited at 2024-12-04 00:24:13 UTC.

Proposal

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

After opening a link to the lastest message of a report and sending a new message, the chat doesn’t auto-scroll to the new message.

What is the root cause of that problem?

Auto-scrolling is disabled if isNavigatingToLinkedMessage is true, meaning that the page is currently navigating to a linked message and hasn’t finished loading.

// AutoScroll is disabled when we do linking to a specific reportAction
const shouldEnableAutoScroll = (hasNewestReportAction && (!reportActionID || !isNavigatingToLinkedMessage)) || (transactionThreadReport && !prevTransactionThreadReport);

isNavigatingToLinkedMessage depends on isTheFirstReportActionIsLinked, which could mean two things:

  1. The newer actions haven't been loaded yet.
  2. There are no newer actions.

In the normal case 1, isNavigatingToLinkedMessage is initially set to true,

if (isTheFirstReportActionIsLinked) {
setNavigatingToLinkedMessage(true);
} else {

and after finishing loading, the linked action is no longer the newest one, so isNavigatingToLinkedMessage is set to false and autoscroll is enabled.

timerID = setTimeout(() => setNavigatingToLinkedMessage(false), 10);

In case 2 where this issue happens, there are no newer actions to load, so isNavigatingToLinkedMessage remains true and auto-scrolling stays disabled.

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

Make sure auto-scrolling is eventually enabled in both cases.

  1. Add reportActions to the dependency array in L463.
}, [isTheFirstReportActionIsLinked, reportActions]); 
  1. Add isFirstLinkedActionRender.current to the condition in L446.
if (isTheFirstReportActionIsLinked && isFirstLinkedActionRender.current) { 

What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?

Verify that ReportActionsView sets shouldEnableAutoScroll correctly for different combinations of reportActions and reportActionId.

Examples of Inputs and Outputs

Name Data
reportActions
undefined
[]
[{reportActionId: 'dummyReportActionId0'}]
[{reportActionId: 'dummyReportActionId0'}, {reportActionId: 'dummyReportActionId1'}]
[{reportActionId: 'dummyReportActionId0'}, {reportActionId: 'dummyReportActionId1'}, {reportActionId: 'dummyReportActionId2'}]
[{reportActionId: 'dummyReportActionId0'}, {reportActionId: 'dummyReportActionId1'}, {reportActionId: 'dummyReportActionId2'}, {reportActionId: 'dummyReportActionId3'}, {reportActionId: 'dummyReportActionId4'}]
reportActionId
undefined
''
'dummyReportActionId0'
'dummyReportActionId1'
'dummyReportActionId2'
'dummyReportActionId3'
'dummyReportActionId4'
shouldEnableAutoScroll
false
true

What alternative solutions did you explore? (Optional)

Copy link

melvin-bot bot commented Dec 5, 2024

@johncschuster @rayane-djouah 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 Dec 5, 2024
@rayane-d
Copy link
Contributor

rayane-d commented Dec 5, 2024

Auto-scrolling is disabled if the latest message is linked.

@QichenZhu, have you discovered why this issue is reproducible only on the native Android platform and not on the web, for example?

Screen.Recording.2024-12-05.at.11.32.21.AM.mov

Copy link

melvin-bot bot commented Feb 3, 2025

The BZ member will need to manually hire rayane-d for the Reviewer role. Please store your Upwork details and apply to our Upwork job so this process is automatic in the future!

Copy link

melvin-bot bot commented Feb 3, 2025

📣 @wildan-m 🎉 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 Feb 4, 2025
@wildan-m
Copy link
Contributor

wildan-m commented Feb 4, 2025

@rayane-d The PR is ready #56293. Thanks!

@perunt
Copy link
Contributor

perunt commented Feb 4, 2025

Just saw this issue and wanted to ask the reviewer to test this as well:

  1. Open the chat.
  2. Scroll halfway up.
  3. Copy the link from the top message.
  4. Send this message in the chat.
  5. Scroll to the bottom (or, if fixed, it should auto-scroll).
  6. Click on the message/link.
  7. Check if the linked message is positioned correctly.
  8. Scroll down and click the link again.

Thanks in advance!

@rayane-d
Copy link
Contributor

rayane-d commented Feb 6, 2025

@perunt - Works well!

Screen.Recording.2025-02-06.at.8.01.00.PM.mov

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels Feb 12, 2025
@melvin-bot melvin-bot bot changed the title [$250] Android - Chat - Chat is not autoscrolled when sending new message after opened from search. [Due for payment 2025-02-19] [$250] Android - Chat - Chat is not autoscrolled when sending new message after opened from search. Feb 12, 2025
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Feb 12, 2025
Copy link

melvin-bot bot commented Feb 12, 2025

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

Copy link

melvin-bot bot commented Feb 12, 2025

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

If no regressions arise, payment will be issued on 2025-02-19. 🎊

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

Copy link

melvin-bot bot commented Feb 12, 2025

@rayane-d @johncschuster @rayane-d 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]

@johncschuster
Copy link
Contributor

BugZero Checklist:

  • [Contributor] Classify the bug:
Bug classification

Source of bug:

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

Where bug was reported:

  • 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
  • 3d. QA
  • 3z. Other:
  • [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:

  • [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:

  • [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 Template
  • [BugZero Assignee] Create a GH issue for creating/updating the regression test once above steps have been agreed upon.

    Link to issue:

Regression Test Proposal

Precondition:

Test:

Do we agree 👍 or 👎

@johncschuster
Copy link
Contributor

Payment Summary

Contributor: @wildan-m paid $250 Upwork
Contributor+: @rayane-d owed $250 via NewDot

@wildan-m can you please complete the BZ Checklist above before the payment deadline? Thanks!

@wildan-m
Copy link
Contributor

@johncschuster did you mean @rayane-d (C+) ?

@rayane-d
Copy link
Contributor

rayane-d commented Feb 16, 2025

BugZero Checklist:

  • [Contributor] Classify the bug:
Bug classification

Source of bug:

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

Where bug was reported:

  • 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
  • 3d. QA
  • 3z. Other:
  • [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/54109/files#r1957433366

  • [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

  • [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:

Regression Test Proposal

Precondition:

  • Sign in with an account that has multiple chats and messages.

Test:

  1. Open the Expensify app.
  2. Tap on "Search"
  3. Select "Chats"
  4. Tap on a message to open the chat.
  5. Write a new message and send it in the chat.
  6. Verify that the chat is auto-scrolled to the bottom.

Do we agree 👍 or 👎

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels Feb 18, 2025
@johncschuster
Copy link
Contributor

Thanks for the checklist, @rayane-d!

@wildan-m, I will issue payment after the regression window has passed tomorrow!
@rayane-d Please go ahead and request payment in ND! Payment Summary, here.

@rayane-d
Copy link
Contributor

Requested in ND

@garrettmknight
Copy link
Contributor

$250 approved for @rayane-d

@johncschuster
Copy link
Contributor

Payment has been issued to @wildan-m! Thanks, all, for your contributions!

@github-project-automation github-project-automation bot moved this from Bugs and Follow Up Issues to Done in [#whatsnext] #expense Feb 19, 2025
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 External Added to denote the issue can be worked on by a contributor
Projects
Status: Done
Development

No branches or pull requests

9 participants