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

[$250] Android - Chat - Chat is not autoscrolled when sending new message after opened from search. #52878

Open
2 of 8 tasks
izarutskaya opened this issue Nov 21, 2024 · 63 comments
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. External Added to denote the issue can be worked on by a contributor Reviewing Has a PR in review Weekly KSv2

Comments

@izarutskaya
Copy link

izarutskaya commented Nov 21, 2024

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.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
@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

@rayane-d
Copy link
Contributor

rayane-d commented Jan 24, 2025

That's regression from this newly merged PR #54071

@wildan-m Could you please report this in the Slack channel?

We might need to hold this issue until that regression is resolved.

@wildan-m
Copy link
Contributor

@rayane-djouah reported here https://expensify.slack.com/archives/C01GTK53T8Q/p1737755959458409

@melvin-bot melvin-bot bot added the Overdue label Jan 27, 2025
Copy link

melvin-bot bot commented Jan 27, 2025

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

@rayane-d
Copy link
Contributor

#54071 is reverted

@melvin-bot melvin-bot bot added Overdue and removed Overdue labels Jan 27, 2025
@johncschuster
Copy link
Contributor

Thanks for the update, @rayane-djouah! What's the next step here? Is a follow-up PR being written?

@melvin-bot melvin-bot bot added Overdue and removed Overdue labels Jan 30, 2025
Copy link

melvin-bot bot commented Feb 3, 2025

@johncschuster, @rayane-djouah Whoops! This issue is 2 days overdue. Let's get this updated quick!

@rayane-d
Copy link
Contributor

rayane-d commented Feb 3, 2025

Sorry for the delay; I was sick at the end of last week. I'll review the issue today.

@melvin-bot melvin-bot bot removed the Overdue label Feb 3, 2025
@rayane-d
Copy link
Contributor

rayane-d commented Feb 3, 2025

Thanks for the update, @rayane-djouah! What's the next step here? Is a follow-up PR being written?

We were holding the issue on this bug which was resolved after the revert of #54071. We can now proceed with this issue.

Copy link

melvin-bot bot commented Feb 3, 2025

📣 @rayane-d! 📣
Hey, it seems we don’t have your contributor details yet! You'll only have to do this once, and this is how we'll hire you on Upwork.
Please follow these steps:

  1. Make sure you've read and understood the contributing guidelines.
  2. Get the email address used to login to your Expensify account. If you don't already have an Expensify account, create one here. If you have multiple accounts (e.g. one for testing), please use your main account email.
  3. Get the link to your Upwork profile. It's necessary because we only pay via Upwork. You can access it by logging in, and then clicking on your name. It'll look like this. If you don't already have an account, sign up for one here.
  4. Copy the format below and paste it in a comment on this issue. Replace the placeholder text with your actual details.
    Screen Shot 2022-11-16 at 4 42 54 PM
    Format:
Contributor details
Your Expensify account email: <REPLACE EMAIL HERE>
Upwork Profile Link: <REPLACE LINK HERE>

@rayane-d
Copy link
Contributor

rayane-d commented Feb 3, 2025

@wildan-m's proposal looks good to me

🎀👀🎀 C+ reviewed

Copy link

melvin-bot bot commented Feb 3, 2025

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

Copy link

melvin-bot bot commented Feb 3, 2025

📣 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 removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Feb 3, 2025
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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something is broken. Auto assigns a BugZero manager. External Added to denote the issue can be worked on by a contributor Reviewing Has a PR in review Weekly KSv2
Projects
Status: Bugs and Follow Up Issues
Development

No branches or pull requests

8 participants