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
[HOLD for payment 2023-07-14] [$1000] Web - UserB can still create a task in room chat when UserA changes post permission to "Admins only" #21791
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
Creates a new room by entering a room name and select UserA's workspace
Set the visibility of the room to "Public"
Clicks on "Create room"
Go to the room details
Select "Share code" and copy the URL to the clipboard
Returns to the previous page and clicks on "Settings" > "Who can post"
In another browser, login to UserB account
Joins the room by pasting the copied URL
Go to the "Assign task" section in the room chat
Change the "Who can post" setting to "Admins only" from UserA account
Now you can create a task in the room chat
Expected Result:
When UserA changes the post permission to "Admins only," UserB should not be able to create a task in the room chat
Actual Result:
Even after UserA changes the post permission to "Admins only," UserB can still create a task in the room chat
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Android / native
Android / Chrome
iOS / native
iOS / Safari
MacOS / Chrome / Safari
MacOS / Desktop
Version Number: 1.3.32-5 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
Please re-state the problem that we are trying to solve in this issue.
UserB can still create a task in room chat when UserA changes post permission to "Admins only"
What is the root cause of that problem?
We don't check to disable auto-set shareSomeWhere in NewTaskPage if the permission of parentReport is changed
What changes do you think we should make in order to solve the problem?
We should add a check here to not set shareSomeWhere value if the permission of parentReport is changed by using ReportUtils.isAllowedToComment function
if (props.task.parentReportID && ReportUtils.isAllowedToComment(lodashGet(props.reports, `report_${props.task.parentReportID}`, {}))) {
I think we also should exclude the report which has permission is admin only in TaskShareDestinationSelectorModal. To do this we could filter props.reports to exclude the report that has permission is admin only and then pass this filter reports into getShareDestinationOptions function instead of props.reports
What alternative solutions did you explore? (Optional)
We also could display not found page specifying user cannot access to assign task by adding FullPageNotFoundView in NewTaskPage with shouldShow prop is !ReportUtils.isAllowedToComment(lodashGet(props.reports, report_${props.task.shareDestination}, {}))
changed the title [-]Web - UserB can still create a task in room chat when UserA changes post permission to "Admins only"[/-][+][$1000] Web - UserB can still create a task in room chat when UserA changes post permission to "Admins only"[/+]on Jun 29, 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:
[@sobitneupane] The PR that introduced the bug has been identified. Link to the PR:
[@sobitneupane] 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:
[@sobitneupane] 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:
It is an edge case. So, I don't think this could have been caught earlier in PR review.
[@sobitneupane] Determine if we should create a regression test for this bug.
Yes.
[@sobitneupane] 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.
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
dukenv0307 commentedon Jun 28, 2023
Proposal
Please re-state the problem that we are trying to solve in this issue.
UserB can still create a task in room chat when UserA changes post permission to "Admins only"
What is the root cause of that problem?
We don't check to disable auto-set shareSomeWhere in
NewTaskPageif the permission of parentReport is changedWhat changes do you think we should make in order to solve the problem?
ReportUtils.isAllowedToCommentfunctionApp/src/pages/tasks/NewTaskPage.js
Line 98 in 09a7432
App/src/pages/tasks/NewTaskPage.js
Line 124 in 09a7432
TaskShareDestinationSelectorModal. To do this we could filterprops.reportsto exclude the report that has permission is admin only and then pass this filter reports intogetShareDestinationOptionsfunction instead ofprops.reportsApp/src/pages/tasks/TaskShareDestinationSelectorModal.js
Line 59 in b2526e5
What alternative solutions did you explore? (Optional)
We also could display not found page specifying user cannot access to assign task by adding
FullPageNotFoundViewinNewTaskPagewithshouldShowprop is!ReportUtils.isAllowedToComment(lodashGet(props.reports, report_${props.task.shareDestination}, {}))melvin-bot commentedon Jun 28, 2023
Triggered auto assignment to @kadiealexander (
Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.melvin-bot commentedon Jun 28, 2023
Bug0 Triage Checklist (Main S/O)
Platformsin OP are ✅)kadiealexander commentedon Jun 29, 2023
Repro'd:
2023-06-29_18-29-09.mp4
[-]Web - UserB can still create a task in room chat when UserA changes post permission to "Admins only"[/-][+][$1000] Web - UserB can still create a task in room chat when UserA changes post permission to "Admins only"[/+]melvin-bot commentedon Jun 29, 2023
Job added to Upwork: https://www.upwork.com/jobs/~01fc548bc92bd6afb3
melvin-bot commentedon Jun 29, 2023
Current assignee @kadiealexander is eligible for the External assigner, not assigning anyone new.
melvin-bot commentedon Jun 29, 2023
Triggered auto assignment to Contributor-plus team member for initial proposal review - @sobitneupane (
External)sobitneupane commentedon Jun 30, 2023
@dukenv0307 Thanks for your proposal.
Can we show a page similar to Not Found Page specifying user don't have access to assign task? It will inform user that he/she no longer have access.
42 remaining items
flaviadefaria commentedon Jul 17, 2023
Payment issued for @dukenv0307 and @ayazhussain79.
ayazhussain79 commentedon Jul 17, 2023
Thank you
flaviadefaria commentedon Jul 18, 2023
@sobitneupane friendy bump here so that we can close this GH.
sobitneupane commentedon Jul 20, 2023
Sorry for the delay @flaviadefaria. I will complete the checklist by tomorrow.
flaviadefaria commentedon Jul 24, 2023
@sobitneupane are you able to complete this today?
sobitneupane commentedon Jul 24, 2023
#17992
#17992 (comment)
It is an edge case. So, I don't think this could have been caught earlier in PR review.
Yes.
sobitneupane commentedon Jul 24, 2023
Regression Test Proposal:
Do we agree 👍 or 👎
sobitneupane commentedon Jul 24, 2023
Requested payment on newDot.
flaviadefaria commentedon Jul 25, 2023
Cool once Anu pays you we can close this.
flaviadefaria commentedon Jul 26, 2023
@anmurali, just for your control this should have been $1500.
JmillsExpensify commentedon Jul 27, 2023
Reviewed details for @sobitneupane. This is accurate based on summary from Business Reviewer and approved for payment in NewDot.
flaviadefaria commentedon Jul 28, 2023
Great so closing this.