-
Notifications
You must be signed in to change notification settings - Fork 3k
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
[$500] Attachment - 'New message' button appears when deleting attachment #39421
Comments
Triggered auto assignment to @deetergp ( |
Triggered auto assignment to @garrettmknight ( |
👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:
|
@garrettmknight 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 this issue might be related to the #vip-vsb. |
Production bandicam.2024-04-02.19-07-13-703.mp4 |
I was able to reproduce this locally. Also navigating away from the chat & back will cause the supposedly deleted attachment to reappear. |
Rerpo'd it as well. I think this could be |
Job added to Upwork: https://www.upwork.com/jobs/~010fcec62910c073e7 |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @jjcoffee ( |
I just reproduced this on prod so it doesn't need to be a blocker |
Please re-state the problem that we are trying to solve in this issue.Attachment - 'New message' button appears when deleting attachment What is the root cause of that problem?The fundamental issue stems from the inaccurate calculation of the canScrollToNewerComments variable, which governs the display of the "New Messages" button. Currently, certain conditions, including !isLoadingInitialReportActions, !hasNewestReportAction, and !isLastPendingActionIsDelete, are incorrectly inverted, resulting in the button being erroneously shown even when there are no unread messages. What changes do you think we should make in order to solve the problem?to solve this problem change here
canScrollToNewerComments: This variable determines whether the "scroll to newer comments" button should be displayed. It evaluates to true if the following conditions are met:
The proposed fix adjusts the canScrollToNewerComments variable to ensure that it evaluates to false when it should not override the other conditions. By modifying the condition to include the correct logic without the use of the logical NOT operator, we ensure that the button is displayed only when necessary. video:-https://drive.google.com/file/d/1dBX9XXeHCps6-OU2qmPJvhpcDts-9p5j/view?usp=sharing |
Reviewing Monday! |
@kaushiktd Thanks, could you explain though what condition (or combination) is causing the button to display in this particular case? I think it would be reckless to flip the logic on all the conditions without understanding why 😄 I feel like your fix probably only works because your changes evaluate
|
canScrollToNewerComments: This variable determines whether the "scroll to newer comments" button should be displayed. It evaluates to true if the following conditions are met:
By accurately evaluating the conditions and addressing the root cause of the issue, we ensure that the button displays correctly in all relevant scenarios |
@kaushiktd Flipping the conditions will likely break the expected behaviour from the comment above the code you're proposing to change: App/src/pages/home/report/ReportActionsList.tsx Lines 612 to 614 in b0c4178
|
Friendly bump @bernhardoj in case you're available and want to take a look at this, since you worked on a related PR recently. |
@jjcoffee As I've mentioned in my last response, by evacuating the conditions the behaviour is expected and will not break.🙂 Still if there is a way for you to test it, I'd love to see the results because it is working as expected for me. |
📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸 |
@deetergp @garrettmknight @jjcoffee this issue is now 4 weeks old, please consider:
Thanks! |
@kaushiktd My problem with your proposal as it stands is that it lacks a clear RCA and the explanatory link to the solution, i.e. why does it work. If you can explain how flipping the In the meantime open to new proposals! |
ProposalPlease re-state the problem that we are trying to solve in this issue.'New messages' floating button appears when the latest message is deleted after crossing a threshold. What is the root cause of that problem?We show the floating message counter when App/src/pages/home/report/ReportActionsList.tsx Lines 616 to 622 in 573d989
but hasNewestReportAction here compares the latest sortedReportAction
but latest sortedReportActions include deleted actions and the check fails even though we are already at the latest message because the latest sortedReportAction created time is of the deleted reportAction's whereas the report's lastVisibleActionCreated is of the present latest message creation time. This check fails and the floating button appears What changes do you think we should make in order to solve the problem?We have App/src/pages/home/report/ReportActionsList.tsx Lines 192 to 199 in 573d989
and this omits the deleted action here App/src/libs/ReportActionsUtils.ts Line 539 in 573d989
So, change the check for hasNewestReportAction above to use sortedVisibleReportActions?.[0].created
What alternative solutions did you explore? (Optional) |
ProposalPlease re-state the problem that we are trying to solve in this issue.'New message' button appears when deleting attachment What is the root cause of that problem?The logic behind canScrollToNewerComments is using a wrong conditions
What changes do you think we should make in order to solve the problem?I suggest implementing a new logic for the "New Message" floating button, similar to the functionality observed in Slack. This button should only appear under specific conditions:
This approach ensures that the button is both contextual and minimally intrusive, improving user experience by providing a quick way to navigate to the first unread message.
By following these steps, we can create a user-friendly navigation feature that closely mirrors the convenient functionality seen in Slack. |
The approach in @c3024's proposal LGTM! It also explains why the scroll button appears after a short delay; I don't think we want to rework the whole way this feature works, as @dragnoir suggests. @kaushiktd's proposal lacks the detail for me to fully analyse it. I strongly doubt it's a workable fix. 🎀👀🎀 C+ reviewed |
Current assignee @deetergp is eligible for the choreEngineerContributorManagement assigner, not assigning anyone new. |
Looks like the selected solution is the same as in my PR here |
📣 @jjcoffee 🎉 An offer has been automatically sent to your Upwork account for the Reviewer role 🎉 Thanks for contributing to the Expensify app! |
📣 @c3024 🎉 An offer has been automatically sent to your Upwork account for the Contributor role 🎉 Thanks for contributing to the Expensify app! Offer link |
@bernhardoj Thanks for the heads up! Hmm I'm not sure what we'd normally do in this situation. This issue is older so it would normally take precedence, but the other issue is also not a straight dupe of this one... |
Just a heads up I'll be OOO 6-13th (I may have some time on the 6th), so this may need to be reassigned depending on what is decided to do here. cc @garrettmknight |
@garrettmknight I pulled latest code and this issue appears to be fixed! |
@deetergp, @garrettmknight, @jjcoffee, @c3024 Uh oh! This issue is overdue by 2 days. Don't forget to update your issues! |
I asked for a re-test here https://expensify.slack.com/archives/C9YU7BX5M/p1715052903386669 |
Issue is fixed. Screen.Recording.2024-05-07.at.3.42.40.in.the.afternoon.mp4 |
@garrettmknight I think we can close this one out. |
Is there anything we need to do before closing this one @garrettmknight? |
Just reviewing - doesn't look like we got a PR up or anything so I'm going to just close since this was fixed elsewhere. |
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.59-0
Reproducible in staging?: Y
Reproducible in production?: N
If this was caught during regression testing, add the test name, ID and link from TestRail: https://expensify.testrail.io/index.php?/tests/view/4468722
Email or phone of affected tester (no customers): [email protected]
Logs: https://stackoverflow.com/c/expensify/questions/4856
Issue reported by: Applause-Internal team
Action Performed:
Expected Result:
'New messages' button shouldn't appear, and attachment should remain deleted
Actual Result:
'New messages' button appears, and attachment reappear when clicking 'New messages' button
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Screenshots/Videos
Bug6435643_1712067883261.Screen_Recording_2024-04-02_at_5.16.43_in_the_afternoon.mp4
View all open jobs on GitHub
Upwork Automation - Do Not Edit
The text was updated successfully, but these errors were encountered: