Skip to content
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] 'All members' option shown on #admins channel #21418

Closed
1 of 6 tasks
kavimuru opened this issue Jun 23, 2023 · 68 comments
Closed
1 of 6 tasks
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor

Comments

@kavimuru
Copy link

kavimuru commented Jun 23, 2023

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. Go to staging dot on web chrome and login with User A
  2. Create a new workspace and invite User B
  3. From User A, notice #admins channel and #announce channel has been created.
  4. On User B side, only #announce channel has been created (which works fine)
  5. On User A side, click on header and click on settings. Notice that on 'Who can post' option, there is the presence of "All members'
  6. User B has no access to admins channel of Uer's A workspace. Thus, in the User A side on admins channel, there should not be a functionality of 'All members' since User A can only use the admins channel

Expected Result:

'All members' option should not be shown on #admins channel
##Actual Result:
'All members' option shown on #admins channel

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?

  • Android / native
  • Android / Chrome
  • iOS / native
  • iOS / Safari
  • MacOS / Chrome / Safari
  • MacOS / Desktop

Version Number: 1.3.31-2
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

error-2023-06-15_12.40.45.mp4
Recording.862.mp4

Expensify/Expensify Issue URL:
Issue reported by: @priya-zha
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1686811997908099

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~0120663c9a61374fde
  • Upwork Job ID: 1673407870785880064
  • Last Price Increase: 2023-06-26
@kavimuru kavimuru added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Jun 23, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jun 23, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Jun 23, 2023

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

@dukenv0307
Copy link
Contributor

dukenv0307 commented Jun 23, 2023

Proposal

Please re-state the problem that we are trying to solve in this issue.

'All members' option shown on #admins channel

What is the root cause of that problem?

const writeCapability = this.props.report.writeCapability || CONST.REPORT.WRITE_CAPABILITIES.ALL;

We are using WRITE_CAPABILITIES is All as default and we also allow change WRITE_CAPABILITIES
Additional, this.props.report.writeCapability from ONYX is all for adminRoom (From BE)

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

We should check if it is adminRoom we will set WRITE_CAPABILITIES default is ADMINS like this


        const writeCapability = ReportUtils.isAdminRoom(this.props.report) ? CONST.REPORT.WRITE_CAPABILITIES.ADMINS :  (this.props.report.writeCapability || CONST.REPORT.WRITE_CAPABILITIES.ALL)

Then we shouldn't allow change WRITE_CAPABILITIES by add the condition like this

Then we shouldn't allow change WRITE_CAPABILITIES by add the condition like this

<MenuItemWithTopDescription
                                disabled={ReportUtils.isAdminRoom(this.props.report)}. // ADD HERE
                                shouldShowRightIcon={!ReportUtils.isAdminRoom(this.props.report)}  // ADD HERE
                                title={writeCapabilityText}
                                description={this.props.translate('writeCapabilityPage.label')}

In case, the user try to access to WriteCapabilityPage by URL /settings/who-can-post, we should show notFoundPage
By add

            <FullPageNotFoundView shouldShow={ReportUtils.isAdminRoom(props.report)}>

in this component https://github.com/Expensify/App/blob/main/src/pages/settings/Report/WriteCapabilityPage.js like this

<ScreenWrapper includeSafeAreaPaddingBottom={false}>
            <FullPageNotFoundView shouldShow={ReportUtils.isAdminRoom(props.report)}>

            <HeaderWithBackButton
                title={props.translate('writeCapabilityPage.label')}
                shouldShowBackButton
           ....
          </FullPageNotFoundView>
</ScreenWrapper>

Result

Screen.Recording.2023-06-21.at.17.25.44.mov

@Pujan92
Copy link
Contributor

Pujan92 commented Jun 23, 2023

Proposal

Please re-state the problem that we are trying to solve in this issue.

'All members' option shown on #admins channel

What is the root cause of that problem?

const shouldAllowWriteCapabilityEditing = lodashGet(linkedWorkspace, 'role', '') === CONST.POLICY.ROLE.ADMIN;

We are allowing the shouldAllowWriteCapabilityEditing when the role is admin without checking the report type.

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

We need to validate chat type and only allow it if it is not policyAdmins.
const shouldAllowWriteCapabilityEditing = !ReportUtils.isAdminRoom(this.props.report) && lodashGet(linkedWorkspace, 'role', '') === CONST.POLICY.ROLE.ADMIN;

Screenshot 2023-06-23 at 8 24 43 PM

@melvin-bot melvin-bot bot added the Overdue label Jun 26, 2023
@maddylewis maddylewis added the External Added to denote the issue can be worked on by a contributor label Jun 26, 2023
@melvin-bot melvin-bot bot changed the title 'All members' option shown on #admins channel [$1000] 'All members' option shown on #admins channel Jun 26, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jun 26, 2023

Job added to Upwork: https://www.upwork.com/jobs/~0120663c9a61374fde

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Jun 26, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jun 26, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Jun 26, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Jun 26, 2023

@sobitneupane, @maddylewis Whoops! This issue is 2 days overdue. Let's get this updated quick!

@maddylewis
Copy link
Contributor

this job has been added to Upwork - #21418 (comment)

proposals will be reviewed this week.

@melvin-bot melvin-bot bot added Overdue and removed Overdue labels Jun 26, 2023
@maddylewis
Copy link
Contributor

@sobitneupane - lmk if you have availability to review proposals for this one this week. if not, i can assign someone else to this issue. thanks!

@melvin-bot melvin-bot bot removed the Overdue label Jun 28, 2023
@sobitneupane
Copy link
Contributor

Proposal from @dukenv0307 looks good to me. We should change the writeCapability to "Admins only" and we should show "Not Found Page" if user doesn't have access.
But rather than disabling the menu item, I will prefer shouldAllowWriteCapabilityEditing to be false to be consistent with other items in the list.

🎀 👀 🎀 C+ reviewed

@melvin-bot
Copy link

melvin-bot bot commented Jun 29, 2023

Triggered auto assignment to @iwiznia, see https://stackoverflow.com/c/expensify/questions/7972 for more details.

@iwiznia
Copy link
Contributor

iwiznia commented Jun 29, 2023

Hmmm I don't think I agree with the proposal, in fact it seems like the backend should be sending this data, but it is not, no? If the backend sent this, then we would not need logic in the frontend that basically mimics what the backend does.
@sobitneupane what do you think?

@sobitneupane
Copy link
Contributor

@iwiznia Yup, I think we can set writeCapability as Admins Only for '#admins' from backend. After that we can make the change in frontend to disable the button.

@dukenv0307
Copy link
Contributor

@iwiznia I agree that we can update from BE side as I said in my proposal

// We should update BE to return correct writeCapability

But we still need to update in FE to disable the button

@melvin-bot melvin-bot bot added the Overdue label Jul 3, 2023
@iwiznia
Copy link
Contributor

iwiznia commented Jul 3, 2023

Sorry I don't follow. Isn't your proposal saying that the frotend will have this logic?

We should check if it is adminRoom we will set WRITE_CAPABILITIES default is ADMINS like this

@melvin-bot melvin-bot bot removed the Overdue label Jul 3, 2023
@priya-zha
Copy link

@maddylewis I haven't recieved the payment for $250 contract since it was also withdrawn. Would you mind sending the offer again? Thanks.

@maddylewis
Copy link
Contributor

thanks @priya-zha - just sent you a new offer :)

@priya-zha
Copy link

Thanks accepted

@maddylewis
Copy link
Contributor

just need to pay @dukenv0307 and then we can close this out.

@iwiznia
Copy link
Contributor

iwiznia commented Jul 21, 2023

Seems this is mostly ready, so not unassigning myself, but if this does not get closed, @maddylewis please unassign and re-assign another engineer since I am going on sabbatical

@sobitneupane
Copy link
Contributor

sobitneupane commented Jul 24, 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:

#19094

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

#19094 (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 was the case missed while adding the functionality. So, I don't think updating PR review checklist will help.

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

@melvin-bot melvin-bot bot removed the Overdue label Jul 24, 2023
@sobitneupane
Copy link
Contributor

Regression Test Proposal

  1. Open an admin channel
  2. Click on header then choose settings
  3. Verify that admin cannot change "Who can post" option and it set to "Admins only"

Do we agree 👍 or 👎

@maddylewis
Copy link
Contributor

regression test added / everyone is paid.

@sobitneupane
Copy link
Contributor

Payment requested on newDot.

@JmillsExpensify
Copy link

@maddylewis Can you please summarize the appropriate individual payments for all parties involved in this issue? This is holding up @sobitneupane's NewDot payments. More information on this compliance process in Slack.

@maddylewis
Copy link
Contributor

@JmillsExpensify - here you go! #21418 (comment)

@JmillsExpensify
Copy link

Ah so to confirm, no urgency bonus applies for this issue?

@maddylewis
Copy link
Contributor

@JmillsExpensify - correct!

@maddylewis maddylewis reopened this Aug 1, 2023
@maddylewis
Copy link
Contributor

maddylewis commented Aug 1, 2023

my original payment breakdown incorrectly excluded the urgency bonus. here is the correct breakdown:

Payments:

i need to process the urgency bonus for @dukenv0307! I'll confirm here once I've done that 👍

@JmillsExpensify
Copy link

JmillsExpensify commented Aug 1, 2023

Great thank you! Yes, looking at the assignment date and then when the PR is merged I agree that this should qualify for an urgency bonus.

Additionally, I've reviewed the details for @sobitneupane. These details are accurate based on summary from Business Reviewer and are now approved for payment in NewDot.

@dukenv0307
Copy link
Contributor

hi @maddylewis I think I was mistakenly paid on 2 different Upwork jobs on this same issue (each for $1k). Can you request a refund for $500 ($2000 actually paid minus $1500 payment)

@maddylewis
Copy link
Contributor

thank you for clarifying that @dukenv0307 - and, yes! on it now.

@maddylewis
Copy link
Contributor

alright, requested that refund. lmk once that's all set and i will close this one out.

@melvin-bot melvin-bot bot added the Overdue label Aug 4, 2023
@maddylewis
Copy link
Contributor

@dukenv0307 - will you lmk if that refund went through on your end? ty!

@melvin-bot melvin-bot bot removed the Overdue label Aug 4, 2023
@dukenv0307
Copy link
Contributor

@maddylewis I thought there might be some processing on Upwork side on that refund but so far I haven't seen any refund request on Upwork or email so I'm not sure how to proceed.

From my side I can proactively "Give a refund" on one of the job if that also works? (But it won't be linked to the refund request you made earlier I think)

@maddylewis
Copy link
Contributor

@dukenv0307 - okay, i tried again. lmk if that went through this time around.

@dukenv0307
Copy link
Contributor

@dukenv0307 - okay, i tried again. lmk if that went through this time around.

@maddylewis done! (it's requested a $1k refund but I did $500 as mentioned here)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor
Projects
None yet
Development

No branches or pull requests

8 participants