Skip to content

[HOLD for payment 2023-12-08] [$500] Android - Chat - Chat does not scroll down to the latest message after requesting money #31373

Closed

Description

@lanitochka17

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:**1.3.99-0
Reproducible in staging?: Y
Reproducible in production?: Y
If this was caught during regression testing, add the test name, ID and link from TestRail:
Email or phone of affected tester (no customers):
Logs: https://stackoverflow.com/c/expensify/questions/4856
Expensify/Expensify Issue URL:
Issue reported by: Applause - Internal Team
Slack conversation:

Action Performed:

  1. Launch New Expensify app
  2. Go to chat with long history
  3. Scroll up
  4. Tap + > Request money
  5. Send a manual request

Expected Result:

The chat will scroll down to the latest message after requesting money

Actual Result:

The chat does not scroll down to the latest message after requesting money

Workaround:

Unknown

Platforms:

Which of our officially supported platforms is this issue occurring on?

  • Android: Native
  • Android: mWeb Chrome
  • iOS: Native
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Add any screenshot/video evidence

Bug6277580_1700056781524.Screen_Recording_20231115_161149_New_Expensify.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~010af8faa2a71dafad
  • Upwork Job ID: 1724805443248058368
  • Last Price Increase: 2023-11-15
  • Automatic offers:
    • esh-g | Contributor | 27756377

Activity

  1. added
    ExternalAdded to denote the issue can be worked on by a contributor
    BugSomething is broken. Auto assigns a BugZero manager.
    on Nov 15, 2023
  2. changed the title [-]Android - Chat - Chat does not scroll down to the latest message after requesting money[/-] [+][$500] Android - Chat - Chat does not scroll down to the latest message after requesting money[/+] on Nov 15, 2023
  3. melvin-bot commented on Nov 15, 2023

    @melvin-bot
  4. melvin-bot commented on Nov 15, 2023

    @melvin-bot

    Triggered auto assignment to @sakluger (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.

  5. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on Nov 15, 2023
  6. melvin-bot commented on Nov 15, 2023

    @melvin-bot

    Bug0 Triage Checklist (Main S/O)

    • This "bug" occurs on a supported platform (ensure Platforms in OP are ✅)
    • This bug is not a duplicate report (check E/App issues and #expensify-bugs)
      • If it is, comment with a link to the original report, close the issue and add any novel details to the original issue instead
    • This bug is reproducible using the reproduction steps in the OP. S/O
      • If the reproduction steps are clear and you're unable to reproduce the bug, check with the reporter and QA first, then close the issue.
      • If the reproduction steps aren't clear and you determine the correct steps, please update the OP.
    • This issue is filled out as thoroughly and clearly as possible
      • Pay special attention to the title, results, platforms where the bug occurs, and if the bug happens on staging/production.
    • I have reviewed and subscribed to the linked Slack conversation to ensure Slack/Github stay in sync
  7. melvin-bot commented on Nov 15, 2023

    @melvin-bot

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

  8. esh-g commented on Nov 15, 2023

    @esh-g
    Contributor

    Proposal

    Please re-state the problem we are trying to solve

    Android - Chat - Chat does not scroll down to the latest message after requesting money

    What is the root cause of the problem

    There are actually two issues that I identified:

    1. If we are in expense report and request money, there is no scroll [on all platforms]
    2. There is no scroll when requesting money anytime only on android

    Root cause for first issue is that in requestMoney while sending the event, we send it incorrectly for the report:

    App/src/libs/actions/IOU.js

    Lines 883 to 884 in 0151ae3

    Navigation.dismissModal(isMoneyRequestReport ? report.reportID : chatReport.reportID);
    Report.notifyNewAction(chatReport.reportID, payeeAccountID);

    Root cause for second issue seems to be the delay that is associated on android with the navigation back from the request money page. Here is how we handle it elsewhere: (with a setTimeout)

    const refID = setTimeout(() => {
    flatListRef.current.scrollToOffset({animated: false, offset: 0});
    }, 10);

    We need to send it to the actual report we are currently subscribed to and not the chat report.

    What changes should be made to fix this?

    We should use the approach used in line 883 with the dismiss modal logic of using the reportID.

    Report.notifyNewAction(isMoneyRequestReport ? report.reportID : chatReport.reportID, payeeAccountID);

    We can of course make this into a separate variable like this:

    const activeReport = isMoneyRequestReport ? report.reportID : chatReport.reportID

    and use this var for both Navigation.dismissModal() and Report.notifyNewAction()

    As for the issue on android, we need to add setTimeout to this part here:

    flatListRef.current.scrollToOffset({animated: false, offset: 0});

    Just like we do here:

    const refID = setTimeout(() => {
    flatListRef.current.scrollToOffset({animated: false, offset: 0});
    }, 10);

  9. narefyev91 commented on Nov 16, 2023

    @narefyev91
    Contributor

    Proposal from @esh-g looks good to me #31373 (comment)
    Let's also try to avoid using setTimeout - (maybe we can find some other solution to make scroll working) - but in any case we can iterate inside PR
    🎀 👀 🎀 C+ reviewed

  10. melvin-bot commented on Nov 16, 2023

    @melvin-bot

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

  11. 9 remaining items

  12. added
    Awaiting PaymentAuto-added when associated PR is deployed to production
    and removed on Dec 1, 2023
  13. changed the title [-][$500] Android - Chat - Chat does not scroll down to the latest message after requesting money[/-] [+][HOLD for payment 2023-12-08] [$500] Android - Chat - Chat does not scroll down to the latest message after requesting money[/+] on Dec 1, 2023
  14. melvin-bot commented on Dec 1, 2023

    @melvin-bot

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

  15. melvin-bot commented on Dec 1, 2023

    @melvin-bot

    The solution for this issue has been 🚀 deployed to production 🚀 in version 1.4.6-2 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 2023-12-08. 🎊

    After the hold period is over and BZ checklist items are completed, please complete any of the applicable payments for this issue, and check them off once done.

    • External issue reporter
    • Contributor that fixed the issue
    • Contributor+ that helped on the issue and/or PR

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

  16. melvin-bot commented on Dec 1, 2023

    @melvin-bot

    BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:

    • [@narefyev91] The PR that introduced the bug has been identified. Link to the PR:
    • [@narefyev91] 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:
    • [@narefyev91] 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:
    • [@narefyev91] Determine if we should create a regression test for this bug.
    • [@narefyev91] 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.
    • [@sakluger] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:
  17. sakluger commented on Dec 7, 2023

    @sakluger
    Contributor

    @narefyev91 mind finishing the BZ checklist when you have a chance?

  18. narefyev91 commented on Dec 8, 2023

    @narefyev91
    Contributor
    • The PR that introduced the bug has been identified. Link to the PR - that was missing functionality for android only - we did not fetch scroll position at all - not a regression from anywhere
    • 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 - N/A
    • 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 - N/A
    • Determine if we should create a regression test for this bug - N/A
  19. sakluger commented on Dec 9, 2023

    @sakluger
    Contributor

    Thanks! This one is all paid out and good to close.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.DailyKSv2ExternalAdded to denote the issue can be worked on by a contributor

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions