Skip to content

[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

Closed

Description

@kbecciv

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:

  1. Login to UserA account
  2. Navigates to the "New room" section
  3. Creates a new room by entering a room name and select UserA's workspace
  4. Set the visibility of the room to "Public"
  5. Clicks on "Create room"
  6. Go to the room details
  7. Select "Share code" and copy the URL to the clipboard
  8. Returns to the previous page and clicks on "Settings" > "Who can post"
  9. In another browser, login to UserB account
  10. Joins the room by pasting the copied URL
  11. Go to the "Assign task" section in the room chat
  12. Change the "Who can post" setting to "Admins only" from UserA account
  13. 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

screen-recording-2023-06-26-at-122853-am_vxzqn8ht.1.mp4
Recording.931.mp4

Expensify/Expensify Issue URL:
Issue reported by: @ayazhussain79
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1687722646703389

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01fc548bc92bd6afb3
  • Upwork Job ID: 1674304197984038912
  • Last Price Increase: 2023-06-29

Activity

  1. added
    Daily
    Bug
    on Jun 28, 2023
  2. dukenv0307 commented on Jun 28, 2023

    @dukenv0307
    Contributor

    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 NewTaskPage if the permission of parentReport is changed

    What changes do you think we should make in order to solve the problem?

    1. 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}`, {}))) {
    

    if (props.task.parentReportID) {

    1. We should add a check here to show an error if shareSomeWhere is already set before the permission of parentReport is changed
    if (!props.task.shareDestination || !ReportUtils.isAllowedToComment(lodashGet(props.reports, `report_${props.task.shareDestination}`, {})))
    

    if (!props.task.shareDestination) {

    1. 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
    const reportExcludeAdminOnly = useMemo(() => {
        let reportFilter = {}
        _.keys(props.reports).forEach((reportKey) => {
            if (ReportUtils.isAllowedToComment(props.reports[reportKey])) {
                reportFilter[reportKey] = props.reports[reportKey];
            }
        })
        return reportFilter;
    }, [props.reports])
    useEffect(() => {
      const {recentReports, personalDetails, userToInvite} = OptionsListUtils.getShareDestinationOptions(
          reportExcludeAdminOnly,
          ...
    

    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}, {}))

  3. melvin-bot commented on Jun 28, 2023

    @melvin-bot

    Triggered auto assignment to @kadiealexander (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.

  4. melvin-bot commented on Jun 28, 2023

    @melvin-bot

    Bug0 Triage Checklist (Main S/O)

    • This "bug" occurs on a supported platform (ensure Platforms in OP are ✅)
    • This bug is not a duplicate report (check E/App issues and #expensify-bugs)
      • If it is, comment with a link to the original report, close the issue and add any novel details to the original issue instead
    • This bug is reproducible using the reproduction steps in the OP. S/O
      • If the reproduction steps are clear and you're unable to reproduce the bug, check with the reporter and QA first, then close the issue.
      • If the reproduction steps aren't clear and you determine the correct steps, please update the OP.
    • This issue is filled out as thoroughly and clearly as possible
      • Pay special attention to the title, results, platforms where the bug occurs, and if the bug happens on staging/production.
    • I have reviewed and subscribed to the linked Slack conversation to ensure Slack/Github stay in sync
  5. kadiealexander commented on Jun 29, 2023

    @kadiealexander
    Contributor

    Repro'd:

    2023-06-29_18-29-09.mp4
  6. added
    External
    on Jun 29, 2023
  7. 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
  8. melvin-bot commented on Jun 29, 2023

    @melvin-bot
  9. added
    Help Wanted
    on Jun 29, 2023
  10. melvin-bot commented on Jun 29, 2023

    @melvin-bot

    Current assignee @kadiealexander is eligible for the External assigner, not assigning anyone new.

  11. melvin-bot commented on Jun 29, 2023

    @melvin-bot

    Triggered auto assignment to Contributor-plus team member for initial proposal review - @sobitneupane (External)

  12. sobitneupane commented on Jun 30, 2023

    @sobitneupane
    Contributor

    @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.

  13. 42 remaining items

  14. flaviadefaria commented on Jul 17, 2023

    @flaviadefaria
    Contributor

    Payment issued for @dukenv0307 and @ayazhussain79.

  15. ayazhussain79 commented on Jul 17, 2023

    @ayazhussain79
    Contributor

    Thank you

  16. flaviadefaria commented on Jul 18, 2023

    @flaviadefaria
    Contributor

    @sobitneupane friendy bump here so that we can close this GH.

  17. sobitneupane commented on Jul 20, 2023

    @sobitneupane
    Contributor

    Sorry for the delay @flaviadefaria. I will complete the checklist by tomorrow.

  18. flaviadefaria commented on Jul 24, 2023

    @flaviadefaria
    Contributor

    @sobitneupane are you able to complete this today?

  19. sobitneupane commented on Jul 24, 2023

    @sobitneupane
    Contributor

    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:

    #17992

    • [@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:

    #17992 (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.
  20. sobitneupane commented on Jul 24, 2023

    @sobitneupane
    Contributor

    Regression Test Proposal:

    1. Login with user A
    2. On another device, login with user B
    3. From user B, create a workspace and invite user A to the workspcae
    4. From user A, go to announce chat of this workspace
    5. Click on plus icon > Assign task
    6. Enter title, description and go to next step
    7. From user B, go to announce chat of this workspace
    8. Change the setting of "Who can post" to "Admins only"
    9. From user A, verify that not found page appears, and after clicking on the back button, the modal is dismissed

    Do we agree 👍 or 👎

  21. sobitneupane commented on Jul 24, 2023

    @sobitneupane
    Contributor

    Requested payment on newDot.

  22. flaviadefaria commented on Jul 25, 2023

    @flaviadefaria
    Contributor

    Cool once Anu pays you we can close this.

  23. flaviadefaria commented on Jul 26, 2023

    @flaviadefaria
    Contributor

    Requested payment on newDot.

    @anmurali, just for your control this should have been $1500.

  24. JmillsExpensify commented on Jul 27, 2023

    @JmillsExpensify
    Contributor

    Reviewed details for @sobitneupane. This is accurate based on summary from Business Reviewer and approved for payment in NewDot.

  25. flaviadefaria commented on Jul 28, 2023

    @flaviadefaria
    Contributor

    Great so closing this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Awaiting PaymentBugDailyExternal

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions