[$250] iOS - Report - Conversation does not scroll down after deleting an attachment
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.64-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/5241542 Issue reported by: Applause - Internal Team
Action Performed:
- Open New Expensify app Hybrid
- Go to the conversation with the history of the message
- Send an image to the conversation
- Delete the sent image
Expected Result:
The conversation should scroll down after deleting the attachment
Actual Result:
Conversation does not scroll down after deleting an attachment
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
- [ ] Android: Standalone
- [ ] Android: HybridApp
- [ ] Android: mWeb Chrome
- [x] iOS: Standalone
- [x] iOS: HybridApp
- [ ] iOS: mWeb Safari
- [ ] MacOS: Chrome / Safari
- [ ] MacOS: Desktop
Screenshots/Videos
Add any screenshot/video evidence
https://github.com/user-attachments/assets/a4b7bd7e-da1c-479a-8ed3-a8d85f179637
Upwork Automation - Do Not Edit
- Upwork Job URL: https://www.upwork.com/jobs/~021859628438339074230
- Upwork Job ID: 1859628438339074230
- Last Price Increase: 2024-12-05
Issue Owner
Current Issue Owner: @Pujan92
Triggered auto assignment to @puneetlath (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.
Proposal
Please re-state the problem that we are trying to solve in this issue.
The chat doesn't scroll after deleting an attachment.
What is the root cause of that problem?
This happens because hasNewestReportAction is false.
https://github.com/Expensify/App/blob/c18812ae3cac59025da0f6c8657750dfcb779a65/src/pages/home/report/ReportActionsView.tsx#L471
hasNewestReportAction compares the last action created with the report lastVisibleActionCreated.
https://github.com/Expensify/App/blob/c18812ae3cac59025da0f6c8657750dfcb779a65/src/pages/home/report/ReportActionsView.tsx#L288
When we delete the attachment, lastVisibleActionCreated is updated to the previous action created. However, the last action is still the deleted attachment.
What changes do you think we should make in order to solve the problem?
Currently, we have 2 places of hasNewestReportAction logic. If we look at the one in ReportActionsList, we can see that the report actions are filtered, so only visible actions will be considered the last action.
https://github.com/Expensify/App/blob/c18812ae3cac59025da0f6c8657750dfcb779a65/src/pages/home/report/ReportActionsList.tsx#L185-L197 https://github.com/Expensify/App/blob/c18812ae3cac59025da0f6c8657750dfcb779a65/src/pages/home/report/ReportActionsList.tsx#L360
So, the hasNewestReportAction in ReportActionList works correctly, but not in ReportActionsView. To fix this, we need to filter out the actions in ReportActionsView too. We can move the filtered actions from ReportActionsList
https://github.com/Expensify/App/blob/c18812ae3cac59025da0f6c8657750dfcb779a65/src/pages/home/report/ReportActionsList.tsx#L185-L197
to ReportActionsView. Then, use it for hasNewestReportAction.
https://github.com/Expensify/App/blob/c18812ae3cac59025da0f6c8657750dfcb779a65/src/pages/home/report/ReportActionsView.tsx#L288
const visibleReportActions = useMemo(
() => reportActions.filter(...),
[reportActions, isOffline],
);
const hasNewestReportAction = visibleReportActions.at(0)?.created === report.lastVisibleActionCreated || visibleReportActions.at(0)?.created === transactionThreadReport?.lastVisibleActionCreated;
Then, pass the filtered actions to ReportActionsList.
<ReportActionsList
sortedVisibleReportActions={visibleReportActions}
we can consider moving the hasNewestReportAction from ReportActionsList to ReportActionsView too, so we only have 1 logic for it
Job added to Upwork: https://www.upwork.com/jobs/~021859628438339074230
Triggered auto assignment to Contributor-plus team member for initial proposal review - @Pujan92 (External)
@puneetlath we can close this issue due to a similar issue has been created earlier and @bernhardoj can transfer their proposal there.
Based on the proposal there, looks like the root cause and solution is different.
RCA of both issues looks similar to me where the issue remains in deriving the hasNewestReportAction due to the different values of last report action created and report lastVisibleActionCreated.
Yes, both issues are because of the wrong value of hasNewestReportAction, but the root cause and solution are still different. I tested my solution and the other issue still persists, so I can't transfer my proposal there because it won't fix that issue.
Do you agree @Pujan92?
@puneetlath, @Pujan92 Whoops! This issue is 2 days overdue. Let's get this updated quick!
@bernhardoj Why the issue appears only for ios and not for android? Bcoz if it is caused by hasNewestReportAction then it should have the same effect on other platforms too.
I think the first issue of this blank space started to happen in https://github.com/Expensify/App/issues/30726 which they fixed in https://github.com/Expensify/App/pull/31670.
This is how the logic looks now which requires hasNewestReportAction.
https://github.com/Expensify/App/blob/c4ff235cbfb6bc6582a3bb045b813e4d43151135/src/pages/home/report/ReportActionsList.tsx#L372-L381
π£ It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? πΈ
@puneetlath, @Pujan92 Eep! 4 days overdue now. Issues have feelings too...
We can proceed with @bernhardoj's proposal to filter actions to consider visible actions only to derive hasNewestReportAction.
πππ C+ reviewed
Current assignee @puneetlath is eligible for the choreEngineerContributorManagement assigner, not assigning anyone new.
@puneetlath @Pujan92 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!
π£ It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? πΈ
@puneetlath, @Pujan92 Whoops! This issue is 2 days overdue. Let's get this updated quick!
PR is ready
cc: @Pujan92
Reviewing label has been removed, please complete the "BugZero Checklist".
The solution for this issue has been :rocket: deployed to production :rocket: in version 9.0.75-6 and is now subject to a 7-day regression period :calendar:. Here is the list of pull requests that resolve this issue:
- https://github.com/Expensify/App/pull/53743
If no regressions arise, payment will be issued on 2024-12-20. :confetti_ball:
For reference, here are some details about the assignees on this issue:
- @Pujan92 requires payment through NewDot Manual Requests
- @bernhardoj requires payment through NewDot Manual Requests
@Pujan92 @Pujan92 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]
Issue is ready for payment but no BZ is assigned. @joekaufmanexpensify you are the lucky winner! Please verify the payment summary looks correct and complete the checklist. Thanks!
Payment Summary
- Reviewer: @Pujan92 owed $250 via NewDot
- Reviewer: @bernhardoj owed $250 via NewDot
BugZero Checklist (@joekaufmanexpensify)
- [x] I have verified the correct assignees and roles are listed above and updated the neccesary manual offers
- [x] I have verified that there are no duplicate or incorrect contracts on Upwork for this job (https://www.upwork.com/ab/applicants/1859628438339074230/hired)
- [x] I have paid out the Upwork contracts or cancelled the ones that are incorrect
- [x] I have verified the payment summary above is correct
Asked in slack so we can get checklist done today.
BugZero Checklist:
- [X] [Contributor] Classify the bug:
Bug classification
Source of bug:
- [ ] 1a. Result of the original design (eg. a case wasn't considered)
- [X] 1b. Mistake during implementation
- [ ] 1c. Backend bug
- [ ] 1z. Other:
Where bug was reported:
- [ ] 2a. Reported on production
- [ ] 2b. Reported on staging (deploy blocker)
- [X] 2c. Reported on both staging and production
- [ ] 2d. Reported on a PR
- [ ] 2z. Other:
Who reported the bug:
- [ ] 3a. Expensify user
- [ ] 3b. Expensify employee
- [ ] 3c. Contributor
- [X] 3d. QA
- [ ] 3z. Other:
-
[X] [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/30269/files#r1894124542
-
[X] [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
-
[X] [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.
-
[x] [BugZero Assignee] Create a GH issue for creating/updating the regression test once above steps have been agreed upon.
Link to issue: https://github.com/Expensify/Expensify/issues/455241
Regression Test Proposal
- Send an attachment to any chat
- Delete the attachment
- Verify the chat is scrolled to the bottom
Do we agree π or π
TY! I shared the regression test issue above, so checklist is all set.
Good to issue payment. We need to pay:
- @bernhardoj - $250 for PR via NewDot.
- @Pujan92 - $250 for C+ via NewDot.
@Pujan92 / @bernhardoj please request payment at your earliest convenience. Closing as this is otherwise all set!