-
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
[Ready for C+ payment via Newdot][$1000] Web - Chat - The flags list are still open even when the attachment was deleted from sender's side #20674
Comments
Triggered auto assignment to @kadiealexander ( |
Bug0 Triage Checklist (Main S/O)
|
ProposalPlease re-state the problem that we are trying to solve in this issue.Web - Chat - The flags list are still open even when the attachment was deleted from sender's side What is the root cause of that problem?We are not checking if the current reportAction is deleted then hide the FlagCommentPage. What changes do you think we should make in order to solve the problem?So we can add a check inside FlagCommentPage to dismiss the modal when reportAction is deleted. React.useEffect(() => {
let reportToCheck;
if (reportAction === undefined) {
reportToCheck = ReportActionsUtils.getParentReportAction(props.report);
} else {
reportToCheck = reportAction
}
if (ReportActionsUtils.isDeletedAction(reportToCheck)) {
Navigation.dismissModal();
}
}, [reportAction, props.report]); What alternative solutions did you explore? (Optional)If we still want to keep the FlagCommentPage visible when comment is deleted, we should add a check when user flag that comment, if it's deleted, we should do nothing and dismiss the modal, so we won't see the flag message from Concierge, so we should update our const flagComment = (severity) => {
let reportID = getReportID(props.route);
// Handle threads if needed
if (reportAction === undefined || reportAction.reportActionID === undefined) {
reportID = ReportUtils.getParentReport(props.report).reportID;
reportAction = ReportActionsUtils.getParentReportAction(props.report);
}
if (!ReportUtils.isDeletedAction(reportAction) {
Report.flagComment(reportID, reportAction, severity);
}
Navigation.dismissModal();
}; |
Looks like something related to As a reminder, please make sure that all proposals are not workarounds and that any and all attempt to fix the issue holistically have been made before proceeding with a solution. Proposals to change our Feel free to drop a note in #expensify-open-source with any questions. |
Updated my proposal to use ReportActionUtils #20674 (comment) |
Reproduced: 2023-06-14_18-17-01.mp4 |
Job added to Upwork: https://www.upwork.com/jobs/~0127efb9c7f0ca6faa |
Current assignee @kadiealexander is eligible for the External assigner, not assigning anyone new. |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @Santhosh-Sellavel ( |
Triggered auto assignment to @francoisl ( |
ProposalPlease re-state the problem that we are trying to solve in this issue.The flags list still opens even when the message was deleted from sender's side What is the root cause of that problem?Actually we don't check if the report action is deleted, we will hide flag comment page What changes do you think we should make in order to solve the problem?We could create a useEffect to check if With this check above, we should move this logic here to before useEffect to get correct reportAction before check it is deleted or not in useEffect because if we don't move this logic when we flag the message that is the first chat of thread, App/src/pages/FlagCommentPage.js Lines 118 to 122 in 23978e4
What alternative solutions did you explore? (Optional)If we want to keep opening the flag page when the message is deleted, in
|
Proposed solutionPlease re-state the problem that we are trying to solve in this issue.The flags list remains open when an attachment is deleted from sender side What is the root cause of that problem? There is no check to verify if a report is deleted or not What changes do you think we should make in order to solve the problem? We need to add a check for deleted report inside the const flagComment = (severity) => {
let reportID = getReportID(props.route);
// Handle threads if needed
if (reportAction === undefined) {
reportID = ReportUtils.getParentReport(props.report).reportID;
reportAction = ReportActionsUtils.getParentReportAction(props.report);
}
React.useEffect(() => {
if (ReportActionsUtils.isDeletedAction(reportAction)) {
Navigation.dismissModal();
}
}, [reportAction]);
Report.flagComment(reportID, reportAction, severity);
Navigation.dismissModal();
}; What alternative solutions did you explore? (Optional)NA |
I don't know if this is a bug - at least with how it works now, the potentially offensive message will still be moderated. cc @dangrous if you have an opinion, since I know you worked on moderation recently. |
Huh, this is an interesting case. I think we wouldn't want the pane to automatically close because I think that would be confusing for the person who was using it. My only question (I have not tested this), is there an error if the flagger chooses an option in this case, or does just nothing happen? If nothing happens, I think we can close this bug. If there's an error, we probably want to update it to notify the flagger that the comment no longer exists, and hide the error. |
@dangrous I've tested, the flagger chooses an option in this case, the message deleted will display with reveal button like this video and after click on this button it display an empty message. So I think we should fix this bug and if expected behavior is display not found page we can wrap this page by FullPageNotFound with Screencast.from.17-06-2023.01.07.25.webm |
Ah got it. @francoisl do you think this is a backend issue? Once the message is fully deleted, shouldn't the report action be removed fully from the front end, and so this wouldn't occur? |
Good point, I wasn't sure so I asked internally, and so basically we could make that change in the backend but it might not be super obvious as there would be other things to take into account like the Unread message marker for example. I'm thinking for now, we can probably do one of the front-end solutions proposed initially, to hide the hide panel. That said, both proposals define the |
Ah yeah, I guess I was combining two things. To clarify (mostly for me):
|
📣 @dukenv0307 You have been assigned to this job by @francoisl! |
@Santhosh-Sellavel The PR is ready to review. |
@dangrous @francoisl I have a recent PR that display not found page if the reportAction cannot flag. But in this, we only test for the case reportAction of the current user and didn't pay attention to the case of this issue. And when @Santhosh-Sellavel ping me here #21658 (comment), I just found the cause in this comment #21658 (comment). So we need to confirm what should we do now in this issue:
App/src/pages/FlagCommentPage.js Line 158 in 0bbf3fc
|
I'll defer to you @francoisl! For me, I think we could potentially keep both, since they're a bit different - I'd still prefer the flag comment page doesn't disappear in the middle of a user looking at it, but would otherwise show not found if it was clicked AFTER something was deleted. I'd also be okay with one of @dukenv0307's suggestions, probably the first one, but I think that would be my second choice. This is all definitely personal opinion though. |
I'm confused here, I'll just wait for @francoisl! |
Hmm yeah not ideal. @dukenv0307 can you think of a way to update your current PR so that it doesn't switch to the |
|
Yes ^
That would sorta work but I think that solution has a disadvantage: if you reload the page while the flag page is open, we would still show the flag options for the deleted message. I can't think of a solution that would basically act as follows:
So taking all that into consideration, I'd say the next best option is to close this issue and the PR, and accept that the current behavior is expected. |
@Santhosh-Sellavel Base on @francoisl 's comment #20674 (comment). I think we can close the PR. |
Based on the 👍 reactions it seems like everyone agrees, so I'm going to close the issue and the PR. Thanks for the proposals and working with through together 🙌 |
@francoisl I think this issue is eligible for compensation since contributors are already assigned and started on the PR. It's just due to other changes, the expectation changes and the solution becomes outdated. Some other similar cases where compensation is made are below: |
Spoken about this privately and agreed to pay out contributor and C+ for this. I have sent Upwork contracts to both. |
@kadiealexander accepted, thank you! |
Payouts due:
Eligible for 50% #urgency bonus? No Upwork job is here. |
Requested $1k on ND |
Reviewed details for @Santhosh-Sellavel. These details are accurate based on summary from Business Reviewer and are now approved for payment in NewDot. |
If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!
Action Performed:
Expected Result:
The flags list should not be open when the attachment was deleted from the sender's side
Actual Result:
The flags list are still open even when the attachment was deleted from sender's side
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Version Number: 1.3.27.2
Reproducible in staging?: yes
Reproducible in production?: yes
If this was caught during regression testing, add the test name, ID and link from TestRail:
Email or phone of affected tester (no customers):
Logs: https://stackoverflow.com/c/expensify/questions/4856
Notes/Photos/Videos: Any additional supporting documentation
error-2023-06-08_11.27.23.mp4
Recording.3088.mp4
Expensify/Expensify Issue URL:
Issue reported by: @priya-zha
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1686207956963489
View all open jobs on GitHub
Upwork Automation - Do Not Edit
The text was updated successfully, but these errors were encountered: