App icon indicating copy to clipboard operation
App copied to clipboard

[HOLD for payment 2024-12-05] [HOLD for payment 2024-12-03] "You don't have the permission to take the requested action" when opening public room thread

Open IuliiaHerets opened this issue 1 year ago β€’ 22 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: 9.0.66-0 Reproducible in staging?: Y Reproducible in production?: N Email or phone of affected tester (no customers): [email protected] Issue reported by: Applause Internal Team

Action Performed:

  1. Go to staging.new.expensify.com
  2. Create a public room.
  3. Send a message to the public room.
  4. Right click on the message > Reply in thread.
  5. Send a reply.
  6. Return to the main chat.
  7. Copy the link to the public room.
  8. Navigate to the link anonymously (logged out).
  9. Click FAB.
  10. Click on the tour link (important).
  11. Return to the public room (still anonymous).
  12. Click on the reply to open the thread.

Expected Result:

The thread will open without error message.

Actual Result:

"You don't have the permission to take the requested action" appears briefly when opening public room thread anonymously.

Workaround:

Unknown

Platforms:

  • [ ] Android: Standalone
  • [ ] Android: HybridApp
  • [x] Android: mWeb Chrome
  • [ ] iOS: Standalone
  • [ ] iOS: HybridApp
  • [ ] iOS: mWeb Safari
  • [x] MacOS: Chrome / Safari
  • [ ] MacOS: Desktop

Screenshots/Videos

Bug6674874_1732462751747!Screenshot_2024-11-24_at_23 36 32

https://github.com/user-attachments/assets/b57128e7-80c0-446f-be6a-761c5115942b

View all open jobs on GitHub

Issue OwnerCurrent Issue Owner: @c3024

IuliiaHerets avatar Nov 24 '24 18:11 IuliiaHerets

Triggered auto assignment to @RachCHopkins (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.

melvin-bot[bot] avatar Nov 24 '24 18:11 melvin-bot[bot]

Triggered auto assignment to @deetergp (DeployBlockerCash), see https://stackoverflowteams.com/c/expensify/questions/9980/ for more details.

melvin-bot[bot] avatar Nov 24 '24 18:11 melvin-bot[bot]

πŸ’¬ A slack conversation has been started in #expensify-open-source

melvin-bot[bot] avatar Nov 24 '24 18:11 melvin-bot[bot]

:wave: Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:

  1. Identify the pull request that introduced this issue and revert it.
  2. Find someone who can quickly fix the issue.
  3. Fix the issue yourself.

github-actions[bot] avatar Nov 24 '24 18:11 github-actions[bot]

Can repro - exactly as described.

RachCHopkins avatar Nov 25 '24 01:11 RachCHopkins

Edited by proposal-police: This proposal was edited at 2024-11-25 05:35:20 UTC.

Proposal

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

"You don't have the permission to take the requested action" appears briefly when opening public room thread anonymously.

What is the root cause of that problem?

Come from PR

We call https://github.com/Expensify/App/blob/f4f8da74c100f2c5ddb666ff4314038010104cbf/src/pages/home/sidebar/SidebarScreen/FloatingActionButtonAndPopover.tsx#L565 when clicking on the tour link. With anonymous user, viewTourTaskReport is undefined. So the taskReportID in completeTask function is -1: https://github.com/Expensify/App/blob/f4f8da74c100f2c5ddb666ff4314038010104cbf/src/libs/actions/Task.ts#L353 hence we store the action to reportActions_-1 to the onyx storage.

  • The bug "You don't have the permission to take the requested action" when opening public room thread is because when we open the thread, we display the mostRecentReportAction:

https://github.com/Expensify/App/blob/f4f8da74c100f2c5ddb666ff4314038010104cbf/src/pages/home/ReportScreen.tsx#L700 that comes from reportActions data. And the reportActions data is from the hook:

https://github.com/Expensify/App/blob/f4f8da74c100f2c5ddb666ff4314038010104cbf/src/hooks/usePaginatedReportActions.ts#L11

that we are falling back to the reportActions_-1 data if the reportID is undefined.

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

We should only call completeTask function:

https://github.com/Expensify/App/blob/f4f8da74c100f2c5ddb666ff4314038010104cbf/src/pages/home/sidebar/SidebarScreen/FloatingActionButtonAndPopover.tsx#L565

if viewTourTaskReport is not undefined.

What alternative solutions did you explore? (Optional)

daledah avatar Nov 25 '24 05:11 daledah

@daledah are you sure you linked the correct PR, it takes me to a not found page

allgandalf avatar Nov 25 '24 12:11 allgandalf

@allgandalf Oh I mistyped, here's the PR

daledah avatar Nov 25 '24 12:11 daledah

Assigning @c3024 as the author of the offending PR, @daledah if your solution is used, we are going to pay you $50 for your help πŸ™Œ

mountiny avatar Nov 25 '24 14:11 mountiny

Fix being CPed

mountiny avatar Nov 25 '24 18:11 mountiny

$50 to @daledah once done as their solution was used

mountiny avatar Nov 25 '24 18:11 mountiny

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

melvin-bot[bot] avatar Nov 26 '24 16:11 melvin-bot[bot]

The solution for this issue has been :rocket: deployed to production :rocket: in version 9.0.66-8 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/53069

If no regressions arise, payment will be issued on 2024-12-03. :confetti_ball:

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

  • @c3024 requires payment (Needs manual offer from BZ)

melvin-bot[bot] avatar Nov 26 '24 16:11 melvin-bot[bot]

@c3024 @RachCHopkins @c3024 The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]

melvin-bot[bot] avatar Nov 26 '24 16:11 melvin-bot[bot]

Offer sent to you @daledah !

RachCHopkins avatar Nov 27 '24 03:11 RachCHopkins

The solution for this issue has been :rocket: deployed to production :rocket: in version 9.0.67-9 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/53069

If no regressions arise, payment will be issued on 2024-12-05. :confetti_ball:

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

  • @c3024 requires payment (Needs manual offer from BZ)

melvin-bot[bot] avatar Nov 28 '24 14:11 melvin-bot[bot]

@c3024 @RachCHopkins @c3024 The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]

melvin-bot[bot] avatar Nov 28 '24 14:11 melvin-bot[bot]

Payment Summary:

  • Contributor: @daledah paid $50 via Upwork
  • Contributor+: @c3024 no payment, due to regression

RachCHopkins avatar Dec 02 '24 22:12 RachCHopkins

@c3024 can you complete the checklist please?

RachCHopkins avatar Dec 02 '24 22:12 RachCHopkins

Payment Summary

Upwork Job

  • ROLE: @c3024 paid $(AMOUNT) via Upwork (LINK)

BugZero Checklist (@RachCHopkins)

  • [ ] I have verified the correct assignees and roles are listed above and updated the neccesary manual offers
  • [ ] I have verified that there are no duplicate or incorrect contracts on Upwork for this job (https://www.upwork.com/ab/applicants//hired)
  • [ ] I have paid out the Upwork contracts or cancelled the ones that are incorrect
  • [ ] I have verified the payment summary above is correct

melvin-bot[bot] avatar Dec 05 '24 09:12 melvin-bot[bot]

@deetergp, @RachCHopkins, @mountiny, @c3024 Whoops! This issue is 2 days overdue. Let's get this updated quick!

melvin-bot[bot] avatar Dec 06 '24 09:12 melvin-bot[bot]

BugZero Checklist:

  • [x] [Contributor] Classify the bug:
Bug classification

Source of bug:

  • [x] 1a. Result of the original design (eg. a case wasn't considered)
  • [ ] 1b. Mistake during implementation
  • [ ] 1c. Backend bug
  • [ ] 1z. Other:

Where bug was reported:

  • [ ] 2a. Reported on production (eg. bug slipped through the normal regression and PR testing process on staging)
  • [x] 2b. Reported on staging (eg. found during regression or PR testing)
  • [ ] 2d. Reported on a PR
  • [ ] 2z. Other:

Who reported the bug:

  • [ ] 3a. Expensify user
  • [ ] 3b. Expensify employee
  • [ ] 3c. Contributor
  • [ ] 3d. QA
  • [ ] 3z. Other:
  • [x] [Contributor] 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: Author of the original PR authored the fix PR too.

  • [x] [Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source 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: No discussion was started because this is too specific a case and could not be identified earlier.

  • [x] [Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.

No regression test is proposed because this was identified during staging.

Regression Test Proposal Template
  • [ ] [BugZero Assignee] Create a GH issue for creating/updating the regression test once above steps have been agreed upon.

    Link to issue:

Regression Test Proposal

Precondition:

Test:

Do we agree πŸ‘ or πŸ‘Ž

c3024 avatar Dec 06 '24 12:12 c3024

Contributor has been paid, the contract has been completed, and the Upwork post has been closed.

RachCHopkins avatar Dec 08 '24 23:12 RachCHopkins