You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[PAID] [$500] Chat - [Attachment] shows in LHN even after close error message #26047
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
Please re-state the problem that we are trying to solve in this issue.
Sending an invalid attachment and then sending a message and deleting it shows [Attachment] in LHN and it does not go away even on clicking close on the error
What is the root cause of that problem?
As long as we don't close the error the report action of failed attachment stays in the report. So when we delete the latest message, the lastVisibleAction is this failed attachment message and this being an attachment, the lastMessageTranslationKey of Report here
gets triggered when clicking close button of the error but it makes no changes to report so the lastMessageTranslationKey stays and the [Attachment] is shown even after clicking the close.
What changes do you think we should make in order to solve the problem?
If an action has errors it should not be considered as lastVisibleAction of the report. So, we should return false for reportActions which have errors here
then when we delete the latest message, the failed attachment report action is not considered as a valid last visible report action and the report action previous to this will be taken as the last visible report action and proper message is displayed in LHN.
This is also in line with PR #24213 and #22342 where when the sent message fails, the lastMessageTranslationKey and lastMessageText are set to the previous values in the failureData. This is why if when the attachment sending fails, the LHN shows the previous message instead of [Attachment] because these PRs restore the lastMessageTranslationKey to previous value in failure data for report.
But when we send another message and delete it, the lastVisibleAction is found afresh and it happens to be the failed report action and the lastMessageTranslationKey of report updates to [Attachment].
So, the solution suggested above of checking errors of report actions prevents any report actions with errors to be last visible action.
What alternative solutions did you explore? (Optional)
We might continue considering the failed report action also as a valid last visible action and change the lastMessageTranslation from [Attachment] to a previous message on clicking the close button by updating the report here
similar to deleteReportComment of Report.js
but this behaviour would be inconsistent with the logic of PRs mentioned above.
Because, with this approach if we send a invalid attachment and it fails, the LHN does not show[Attachment] then (case 1) but if we send another message and delete it now the LHN shows [Attachment] (case 2) because the last visible action is found freshly again. Even though case 1 and 2 are identical, the LHN shows differently. So I think the first solution to exclude report actions with errors when finding lastVisibleAction is the better solution and consistent with existing behaviour.
changed the title [-]Chat - [Attachment] shows in LHN even after close error message[/-][+][$500] Chat - [Attachment] shows in LHN even after close error message[/+]on Sep 1, 2023
changed the title [-][$500] Chat - [Attachment] shows in LHN even after close error message[/-][+][HOLD for payment 2023-09-13] [$500] Chat - [Attachment] shows in LHN even after close error message[/+]on Sep 6, 2023
The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.64-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-09-13. 🎊
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:
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:
[@s77rt] The PR that introduced the bug has been identified. Link to the PR:
[@s77rt] 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:
[@s77rt] 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:
[@s77rt] Determine if we should create a regression test for this bug.
[@s77rt] 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.
[@strepanier03] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:
changed the title [-][HOLD for payment 2023-09-13] [$500] Chat - [Attachment] shows in LHN even after close error message[/-][+][PAID] [$500] Chat - [Attachment] shows in LHN even after close error message[/+]on Sep 14, 2023
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
Activity
melvin-bot commentedon Aug 28, 2023
Triggered auto assignment to @strepanier03 (
Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.melvin-bot commentedon Aug 28, 2023
Bug0 Triage Checklist (Main S/O)
Platformsin OP are ✅)c3024 commentedon Aug 28, 2023
Proposal
Please re-state the problem that we are trying to solve in this issue.
Sending an invalid attachment and then sending a message and deleting it shows
[Attachment]in LHN and it does not go away even on clicking close on the errorWhat is the root cause of that problem?
As long as we don't close the error the report action of failed attachment stays in the report. So when we delete the latest message, the
lastVisibleActionis this failed attachment message and this being an attachment, thelastMessageTranslationKeyofReporthereApp/src/libs/actions/Report.js
Line 956 in 03cf0b1
becomes
[Attachment]and the LHN shows[Attachment]This here
App/src/libs/actions/ReportActions.js
Line 10 in 03cf0b1
gets triggered when clicking close button of the error but it makes no changes to report so the
lastMessageTranslationKeystays and the[Attachment]is shown even after clicking the close.What changes do you think we should make in order to solve the problem?
If an action has errors it should not be considered as
lastVisibleActionof the report. So, we should returnfalseforreportActionswhich have errors hereApp/src/libs/ReportActionsUtils.js
Lines 360 to 363 in 03cf0b1
by modifying the conditional to
then when we delete the latest message, the failed attachment report action is not considered as a valid last visible report action and the report action previous to this will be taken as the last visible report action and proper message is displayed in LHN.
This is also in line with PR #24213 and #22342 where when the sent message fails, the
lastMessageTranslationKeyandlastMessageTextare set to the previous values in thefailureData. This is why if when the attachment sending fails, the LHN shows the previous message instead of[Attachment]because these PRs restore thelastMessageTranslationKeyto previous value in failure data for report.But when we send another message and delete it, the
lastVisibleActionis found afresh and it happens to be the failed report action and thelastMessageTranslationKeyof report updates to[Attachment].So, the solution suggested above of checking errors of report actions prevents any report actions with errors to be last visible action.
What alternative solutions did you explore? (Optional)
We might continue considering the failed report action also as a valid last visible action and change the
lastMessageTranslationfrom[Attachment]to a previous message on clicking the close button by updating the report hereApp/src/libs/actions/ReportActions.js
Lines 12 to 15 in f9d760f
with this
similar to
deleteReportCommentofReport.jsbut this behaviour would be inconsistent with the logic of PRs mentioned above.
Because, with this approach if we send a invalid attachment and it fails, the LHN does not show
[Attachment]then (case 1) but if we send another message and delete it now the LHN shows[Attachment](case 2) because the last visible action is found freshly again. Even though case 1 and 2 are identical, the LHN shows differently. So I think the first solution to exclude report actions with errors when findinglastVisibleActionis the better solution and consistent with existing behaviour.Result
updateLastVisibleActionCorrectly.mov
strepanier03 commentedon Aug 30, 2023
Reached out internally for a discussion about this and will update tomorrow.
[-]Chat - [Attachment] shows in LHN even after close error message[/-][+][$500] Chat - [Attachment] shows in LHN even after close error message[/+]melvin-bot commentedon Sep 1, 2023
Job added to Upwork: https://www.upwork.com/jobs/~01aad872dd6b0a5da1
melvin-bot commentedon Sep 1, 2023
Current assignee @strepanier03 is eligible for the External assigner, not assigning anyone new.
melvin-bot commentedon Sep 1, 2023
Triggered auto assignment to Contributor-plus team member for initial proposal review - @s77rt (
External)18 remaining items
[-][$500] Chat - [Attachment] shows in LHN even after close error message[/-][+][HOLD for payment 2023-09-13] [$500] Chat - [Attachment] shows in LHN even after close error message[/+]melvin-bot commentedon Sep 6, 2023
Reviewinglabel has been removed, please complete the "BugZero Checklist".melvin-bot commentedon Sep 6, 2023
The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.64-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-09-13. 🎊
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.
For reference, here are some details about the assignees on this issue:
As a reminder, here are the bonuses/penalties that should be applied for any External issue:
melvin-bot commentedon Sep 6, 2023
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:
s77rt commentedon Sep 6, 2023
strepanier03 commentedon Sep 13, 2023
@s77rt and @c3024 - I have paid you via Upwork and closed the contracts/left feedback. Thanks again!
@gadhiyamanan - Once you accept the offer let me know here so I can pay it as well.
Thanks!
gadhiyamanan commentedon Sep 14, 2023
@strepanier03 offer accepted but the amount of offer is $50. It is eligible for $250 because it is logged before 30 aug. Please add $200 as bonus
strepanier03 commentedon Sep 14, 2023
@gadhiyamanan - Got it, thanks for the heads up. I've paid you out at the previous $250 price since this issue was created before the 30th of August.
All set here now, closing out.
[-][HOLD for payment 2023-09-13] [$500] Chat - [Attachment] shows in LHN even after close error message[/-][+][PAID] [$500] Chat - [Attachment] shows in LHN even after close error message[/+]