IOS - Chat - Chat does not scroll down to bottom when error appears
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
- Go to any chat
- Send a corrupted PDF file (there is one attached to this report)
- Wait for the uploading message to be grayed out
- Scroll down
- 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
Triggered auto assignment to @stephanieelliott (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.
@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
We think that this bug might be related to #vip-vsp
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]);
I don't think we need to optimize for corrupted PDF files since since that should be pretty uncommon. Gonna close for now.
@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.
@stephanieelliott Can you have a look?