App icon indicating copy to clipboard operation
App copied to clipboard

IOS - Chat - Chat does not scroll down to bottom when error appears

Open lanitochka17 opened this issue 1 year ago • 4 comments

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: 1.4.58-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: https://expensify.testrail.io/index.php?/tests/view/4466121 Email or phone of affected tester (no customers): [email protected] Issue reported by: Applause - Internal Team

Action Performed:

Pre-requisite: the user must be logged in

  1. Go to any chat
  2. Send a corrupted PDF file (there is one attached to this report)
  3. Wait for the uploading message to be grayed out
  4. Scroll down
  5. Verify that an error is displayed

Expected Result:

The chat should auto-scroll to the bottom when the error message appears

Actual Result:

The error appears but the chat does not auto-scroll to the bottom

Workaround:

Unknown

Platforms:

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

  • [ ] Android: Native
  • [ ] Android: mWeb Chrome
  • [x] iOS: Native
  • [ ] iOS: mWeb Safari
  • [ ] MacOS: Chrome / Safari
  • [ ] MacOS: Desktop

Screenshots/Videos

Add any screenshot/video evidence

https://github.com/Expensify/App/assets/78819774/cfea9d6a-b9d1-4702-8ccd-4824cea13747

View all open jobs on GitHub

lanitochka17 avatar Mar 29 '24 19:03 lanitochka17

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

melvin-bot[bot] avatar Mar 29 '24 19:03 melvin-bot[bot]

@stephanieelliott FYI I haven't added the External label as I wasn't 100% sure about this issue. Please take a look and add the label if you agree it's a bug and can be handled by external contributors

lanitochka17 avatar Mar 29 '24 19:03 lanitochka17

We think that this bug might be related to #vip-vsp

lanitochka17 avatar Mar 29 '24 19:03 lanitochka17

Proposal

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

Chat doesn't scroll to bottom when any error appears via MessagesRow.

What is the root cause of that problem?

InvertedFlatList fails to scroll when MessagesRow shows up with error message. Similar issue was there with actionable whispers also which is already handled in the code.

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

Add the following useEffect in ReportActionItem to scroll when error shows up:

useEffect(() => {
    if (index !== 0 || !action.errors) {
        return;
    }

    reportScrollManager.scrollToIndex(index);
}, [index, action, reportScrollManager]);

ShridharGoel avatar Mar 30 '24 07:03 ShridharGoel

I don't think we need to optimize for corrupted PDF files since since that should be pretty uncommon. Gonna close for now.

stephanieelliott avatar Apr 03 '24 01:04 stephanieelliott

@stephanieelliott This also impacts other errors, its not just about corrupted PDF files. Whenever any such error shows, user would not even know that an error is there since the scroll would not happen.

ShridharGoel avatar Apr 07 '24 11:04 ShridharGoel

@stephanieelliott Can you have a look?

ShridharGoel avatar Apr 10 '24 06:04 ShridharGoel