-
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
[HOLD for payment 2023-07-14] [$1000] Error message displayed when User flags a message with no permission in a group chat #21719
Comments
Triggered auto assignment to @twisterdotcom ( |
Bug0 Triage Checklist (Main S/O)
|
ProposalPlease re-state the problem that we are trying to solve in this issue.Error message displayed when User flags a message with no permission in a group chat What is the root cause of that problem?We're allowing user to flag comment even they didn't have the permission in the room in here: App/src/pages/home/report/ContextMenu/ContextMenuActions.js Lines 322 to 328 in 52a1891
But from our server, if users don't have permission, they also don't have permission to flag the comment, which caused the issue. What changes do you think we should make in order to solve the problem?We need to check if current user didn't have permission to comment, then we should hide the flag comment in our context menu. shouldShow: (type, reportAction, isArchivedRoom, betas, menuTarget, isChronosReport, reportID) =>
type === CONTEXT_MENU_TYPES.REPORT_ACTION &&
ReportUtils.canFlagReportAction(reportAction, reportID) &&
!isArchivedRoom &&
!isChronosReport &&
!ReportUtils.isConciergeChatReport(reportID) &&
reportAction.actorEmail !== CONST.EMAIL.CONCIERGE &&
ReportUtils.isAllowedToComment(ReportUtils.getReport(reportID)), We can also do the same with Incase a FlagCommentPage was already opened while the room setting was changed to "Admins only", we can add a FullPageNotFoundView inside What alternative solutions did you explore? (Optional)N/A |
I am OOO! Adding another BZ member for the week. |
Triggered auto assignment to @anmurali ( |
Job added to Upwork: https://www.upwork.com/jobs/~0129a94963f8137bb5 |
Current assignee @anmurali is eligible for the External assigner, not assigning anyone new. |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @allroundexperts ( |
ProposalPlease re-state the problem that we are trying to solve in this issue.Error message displayed when User flags a message with no permission in a group chat What is the root cause of that problem?Currently, on the FE side, we allow users to flag messages in a room that only allows the admin to post comments. What changes do you think we should make in order to solve the problem?Lines 223 to 230 in 3404111
We should update canFlagReportAction to prevent user flag comments without permission in a room like this
After updating canFlagReportAction function, if the user access to flag comment page by URL without permission It will show NotFoundPage as we implemented in this PR Optional: I also see user can reply in the thread in the room that the user doesn't have permission. If we want to prevent the user reply in the thread we can add the same condition as above What alternative solutions did you explore? (Optional) |
Thanks for your proposal @dukenv0307. I did not find your proposal much different than what @hungvu193 suggested here. The check which you suggested to add in Since @hungvu193 was the first one to propose the correct solution, I suggest that we go with them. @hungvu193 I think we do not need to disable the thread option if the backend is not throwing any error for creating a thread. 🎀 👀 🎀 C+ reviewed |
Triggered auto assignment to @danieldoglas, see https://stackoverflow.com/c/expensify/questions/7972 for more details. |
@allroundexperts Thanks for your review. I see that we also need to fix the edge case when the user access to flag comment page by URL.
With @hungvu193's proposal we need to fix 2 places with redundant code and it makes the code base become difficult to maintain |
I think this optimisation can be handled in the PR easily. |
📣 @allroundexperts 🎉 An offer has been automatically sent to your Upwork account 🎉 Reviewer - [$1000] Error message displayed when User flags a message with no permission in a group chat |
📣 @hungvu193 🎉 An offer has been automatically sent to your Upwork account 🎉 Contributor - [$1000] Error message displayed when User flags a message with no permission in a group chat Please accept the offer and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review 🧑💻 |
📣 @ayazhussain79 You have been assigned to this job! |
|
The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.37-7 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-07-14. 🎊 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.
As a reminder, here are the bonuses/penalties that should be applied for any External 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:
|
Assigned Jul 3, 11:25am Why was there no celebratory this was done within 3 days comment? |
@twisterdotcom Offer accepted, Thank you |
@twisterdotcom The checklist does not seem to be applicable here. Looks like we did not take this into account when creating the message flagging feature. |
@allroundexperts is paid |
@twisterdotcom Can you please withdraw the offer on Upwork? Thanks! |
I cannot load Upwork today sorry. This will need to be done Monday. |
If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!
Action Performed:
13 Now click on “flag as offensive”
Expected Result:
Error message "Auth CreateReportAction returned an error" displayed when UserB flags a message without posting permission in a group chat
Actual Result:
The error message "Auth CreateReportAction returned an error" is displayed when UserB flags a message without having permission to post in the group chat
Workaround:
Can the user still use Expensify without this being fixed? Have you informed them of the workaround?
Platforms:
Which of our officially supported platforms is this issue occurring on?
Version Number: 1.3.33-4
Reproducible in staging?: y
Reproducible in production?: y
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
screen-recording-2023-06-24-at-82841-pm_IQp5roly.mp4
Recording.1119.mp4
Expensify/Expensify Issue URL:
Issue reported by: @ayazhussain79
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1687621449744259
View all open jobs on GitHub
Upwork Automation - Do Not Edit
The text was updated successfully, but these errors were encountered: