App icon indicating copy to clipboard operation
App copied to clipboard

[HOLD for payment 2024-02-07] [$500] Policy member can't rename the room

Open kavimuru opened this issue 1 year ago β€’ 17 comments

If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!


Version Number: 1.4.30-0 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 Expensify/Expensify Issue URL: Issue reported by: @jasperhuangg Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1705942899968899

Action Performed:

  1. Create room as account A and user B is member of the workspace of the room created
  2. login as user B and open the room created in step1

Expected Result:

User B is able to edit the room name

Actual Result:

Unable to edit

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: mWeb Chrome
  • [ ] iOS: Native
  • [ ] iOS: mWeb Safari
  • [x] MacOS: Chrome / Safari
  • [ ] MacOS: Desktop

Screenshots/Videos

Add any screenshot/video evidence

Snip - (4) New Expensify - Google Chrome (3)

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~016496a22ef9dd8599
  • Upwork Job ID: 1749697772594622464
  • Last Price Increase: 2024-01-23
  • Automatic offers:
    • bernhardoj | Contributor | 28122724

kavimuru avatar Jan 23 '24 07:01 kavimuru

Job added to Upwork: https://www.upwork.com/jobs/~016496a22ef9dd8599

melvin-bot[bot] avatar Jan 23 '24 07:01 melvin-bot[bot]

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

melvin-bot[bot] avatar Jan 23 '24 07:01 melvin-bot[bot]

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

melvin-bot[bot] avatar Jan 23 '24 07:01 melvin-bot[bot]

Proposal

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

Workspace member can't rename the room name.

What is the root cause of that problem?

We currently disallow member to edit the name. https://github.com/Expensify/App/blob/c0608977d90835b34382325732e755733c034240/src/libs/ReportUtils.ts#L4186-L4193

and only allow for workspace owner and admin.

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

If the user is a member of the workspace, then returns false (instead of the long condition)

bernhardoj avatar Jan 23 '24 07:01 bernhardoj

Proposal

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

Unable to edit

What is the root cause of that problem?

We only allow admin to edit the room name

https://github.com/Expensify/App/blob/c0608977d90835b34382325732e755733c034240/src/libs/ReportUtils.ts#L4190-L4192

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

We can change this condition to

    return !Object.keys(loginList ?? {}).includes(policy.owner) && policy.role === CONST.POLICY.ROLE.AUDITOR;

so admin and user can edit the room name

What alternative solutions did you explore? (Optional)

NA

tienifr avatar Jan 23 '24 07:01 tienifr

I agree that we should allow anyone in the room to rename the room - I think this can be external and we have some proposals to review when you have a moment @Santhosh-Sellavel

Christinadobrzyn avatar Jan 23 '24 18:01 Christinadobrzyn

@bernhardoj

If the user is a member of the workspace, then returns false (instead of the long condition)

How you would check that? Can you share the changes you propose in a new comment? thanks!

@Christinadobrzyn
Can a user with a role auditor edit roomname?

Santhosh-Sellavel avatar Jan 23 '24 19:01 Santhosh-Sellavel

if (!policy) {
    return true
}

return false

We will just do it like this. If the policy onyx data exists, then the user is a member of the policy.

https://github.com/Expensify/App/blob/c0608977d90835b34382325732e755733c034240/src/libs/ReportUtils.ts#L4190-L4191 https://github.com/Expensify/App/blob/c0608977d90835b34382325732e755733c034240/src/libs/ReportUtils.ts#L4184-L4188

bernhardoj avatar Jan 24 '24 02:01 bernhardoj

@bernhardoj's proposal looks good to me!

C+ Reviewed πŸŽ€ πŸ‘€ πŸŽ€

Santhosh-Sellavel avatar Jan 24 '24 19:01 Santhosh-Sellavel

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

melvin-bot[bot] avatar Jan 24 '24 19:01 melvin-bot[bot]

πŸ“£ @bernhardoj πŸŽ‰ An offer has been automatically sent to your Upwork account for the Contributor role πŸŽ‰ Thanks for contributing to the Expensify app!

Offer link Upwork job 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 πŸ§‘β€πŸ’» Keep in mind: Code of Conduct | Contributing πŸ“–

melvin-bot[bot] avatar Jan 26 '24 00:01 melvin-bot[bot]

PR is ready

cc: @Santhosh-Sellavel

bernhardoj avatar Jan 26 '24 06:01 bernhardoj

Reviewing label has been removed, please complete the "BugZero Checklist".

melvin-bot[bot] avatar Jan 31 '24 22:01 melvin-bot[bot]

The solution for this issue has been :rocket: deployed to production :rocket: in version 1.4.34-1 and is now subject to a 7-day regression period :calendar:. Here is the list of pull requests that resolve this issue:

  • https://github.com/Expensify/App/pull/35223

If no regressions arise, payment will be issued on 2024-02-07. :confetti_ball:

For reference, here are some details about the assignees on this issue:

  • @bernhardoj requires payment automatic offer (Contributor)
  • @Santhosh-Sellavel requires payment through NewDot Manual Requests

melvin-bot[bot] avatar Jan 31 '24 22:01 melvin-bot[bot]

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:

  • [ ] [@Santhosh-Sellavel] The PR that introduced the bug has been identified. Link to the PR:
  • [ ] [@Santhosh-Sellavel] 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:
  • [ ] [@Santhosh-Sellavel] 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:
  • [ ] [@Santhosh-Sellavel] Determine if we should create a regression test for this bug.
  • [ ] [@Santhosh-Sellavel] 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.
  • [ ] [@Christinadobrzyn] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:

melvin-bot[bot] avatar Jan 31 '24 22:01 melvin-bot[bot]

We can skip the checklist here, it was intentional earlier & we are allowing members to update now.

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:

  • [x] [@Santhosh-Sellavel] The PR that introduced the bug has been identified. Link to the PR: N/A
  • [x] [@Santhosh-Sellavel] 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: N/A
  • [x] [@Santhosh-Sellavel] 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: N/A
  • [x] [@Santhosh-Sellavel] Determine if we should create a regression test for this bug. N/A
  • [x] [@Santhosh-Sellavel] 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. N/A
  • [x] [@Christinadobrzyn] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:

Santhosh-Sellavel avatar Feb 02 '24 18:02 Santhosh-Sellavel

payment tomorrow

Payouts due:

Contributor: $500 @bernhardoj (In Upwork - https://www.upwork.com/nx/wm/offer/28122724) Contributor+: $500 @Santhosh-Sellavel (in NewExpensify)

Christinadobrzyn avatar Feb 07 '24 00:02 Christinadobrzyn

Payment day!

paid out based on this payment summary - https://github.com/Expensify/App/issues/34950#issuecomment-1931014376

No regression test so I think this can be closed as complete! Thanks every one!

Christinadobrzyn avatar Feb 08 '24 00:02 Christinadobrzyn

Requested on ND

Santhosh-Sellavel avatar Feb 10 '24 20:02 Santhosh-Sellavel

$500 approved for @Santhosh-Sellavel based on summary above.

JmillsExpensify avatar Feb 11 '24 13:02 JmillsExpensify