App icon indicating copy to clipboard operation
App copied to clipboard

[$250] Onboarding - RBR with error in tour task when opening tour link after deleting workspace

Open vincdargento opened this issue 1 year ago β€’ 6 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.71-0 Reproducible in staging?: Yes Reproducible in production?: Yes If this was caught on HybridApp, is this reproducible on New Expensify Standalone?: N/A If this was caught during regression testing, add the test name, ID and link from TestRail: N/A 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. Sign up with a new Gmail account (random email without +).
  3. On onboarding purpose, choose Manage my team's expenses.
  4. Select organization size.
  5. Select an accounting.
  6. Complete the onboarding.
  7. Delete the workspace.
  8. Open FAB.
  9. Click on the tour link.

Expected Result:

App will not attempt to auto complete the onboarding task "Take a 2-minute tour" in #admins room because the workspace is deleted and #admins room is achieved, which means the task is no longer editable.

Actual Result:

App auto completes the onboarding task "Take a 2-minute tour" when #admins room is archived and it throws RBR with "You don't have permission to take the requested action".

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

https://github.com/user-attachments/assets/fca8b1b0-9637-4362-b049-0c93bfd07a56

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021865098396796930432
  • Upwork Job ID: 1865098396796930432
  • Last Price Increase: 2024-12-06
Issue OwnerCurrent Issue Owner: @allgandalf

vincdargento avatar Dec 04 '24 15:12 vincdargento

Triggered auto assignment to @CortneyOfstad (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 Dec 04 '24 15:12 melvin-bot[bot]

Proposal

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

  • App auto completes the onboarding task "Take a 2-minute tour" when #admins room is archived and it throws RBR with "You don't have permission to take the requested action".

What is the root cause of that problem?

  • When clicking on view tour, we call:

https://github.com/Expensify/App/blob/c049ac7ec616db1d936c021b08b17a35eb418fd3/src/pages/home/sidebar/SidebarScreen/FloatingActionButtonAndPopover.tsx#L564-L566 without checking whether the current user can complete the task like we did in:

https://github.com/Expensify/App/blob/c049ac7ec616db1d936c021b08b17a35eb418fd3/src/components/ReportActionItem/TaskView.tsx#L117

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

  • We should update the above code to:
                                      if (viewTourTaskReport && canModifyTask && canActionTask) {
                                          Task.completeTask(viewTourTaskReport);
                                      }

with

    const canModifyTask = Task.canModifyTask(viewTourTaskReport, currentUserPersonalDetails.accountID);
    const canActionTask = Task.canActionTask(viewTourTaskReport, currentUserPersonalDetails.accountID);

and apply the same in: https://github.com/Expensify/App/blob/c049ac7ec616db1d936c021b08b17a35eb418fd3/src/pages/Search/EmptySearchView.tsx#L150

  • Using the condition canModifyTask && canActionTask will cover all the case that user cannot complete the task, such as the report is archived, the task is canceled, user is not assignee, ...

What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?

  • We should mock the viewTourTaskReport data for the cases: report is archived, the task is canceled, the task report is not archived and the task is not cancelled.

  • For each case, trigger the click on "Take a 2-minute tour" button.

  • Verify the Task.completeTask(viewTourTaskReport) is not triggered in 1st, 2nd case but in 3rd case.

What alternative solutions did you explore? (Optional)

  • We can only use canModifyTask instead of canModifyTask && canActionTask so if the current user is not task owner or task assignee, they can Task.completeTask(viewTourTaskReport) as well.

truph01 avatar Dec 04 '24 20:12 truph01

Was able to recreate, so getting eyes on this!

CortneyOfstad avatar Dec 06 '24 18:12 CortneyOfstad

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

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

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

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

Not able to reproduce on staging.new.expensify.com

https://github.com/user-attachments/assets/157575fe-128c-4d91-9894-2ad60055c95e

umairx97 avatar Dec 06 '24 21:12 umairx97

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

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

I'm also not able to recreate, so going to close! If anyone can consistently recreate, please let me know and we can reopen πŸ‘

CortneyOfstad avatar Dec 11 '24 18:12 CortneyOfstad

@CortneyOfstad As mentioned in my proposal, we can reproduce the bug with the new steps below:

  1. Go to staging.new.expensify.com
  2. Sign up with a new Gmail account (random email without +).
  3. On onboarding purpose, choose Manage my team's expenses.
  4. Select organization size.
  5. Select an accounting.
  6. Complete the onboarding.
  7. Go to conciege > Choose "Take 2 minutes tour" task> Click on the header > Delete the task
  8. Open FAB.
  9. Click on the tour link.
  10. Verify it throws RBR with "You don't have permission to take the requested action".

https://github.com/user-attachments/assets/bdff266d-6854-432d-a884-bc438834b8dd

truph01 avatar Dec 11 '24 20:12 truph01

@allgandalf Can you reproduce the bug with my steps above?

truph01 avatar Dec 12 '24 19:12 truph01

@allgandalf Could you help check this issue when you have a chance? Thanks

truph01 avatar Dec 16 '24 10:12 truph01

@truph01 can you test again and if this is still reproducible then please post on #open-source channel tagging me and @CortneyOfstad to reopen the issue, thanks :))

allgandalf avatar Dec 16 '24 10:12 allgandalf

Per this post, reopening. Thanks @truph01!

CortneyOfstad avatar Dec 16 '24 14:12 CortneyOfstad

πŸ“£ It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? πŸ’Έ

melvin-bot[bot] avatar Dec 16 '24 16:12 melvin-bot[bot]

@allgandalf any thoughts on the proposal here?

CortneyOfstad avatar Dec 17 '24 20:12 CortneyOfstad

I will look today

allgandalf avatar Dec 18 '24 07:12 allgandalf

@CortneyOfstad @allgandalf this issue was created 2 weeks ago. Are we close to approving a proposal? If not, what's blocking us from getting this issue assigned? Don't hesitate to create a thread in #expensify-open-source to align faster in real time. Thanks!

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

@allgandalf What do you think about my proposal? Could you help review it once you have a sec? Thanks

truph01 avatar Dec 23 '24 08:12 truph01

@CortneyOfstad, @allgandalf Eep! 4 days overdue now. Issues have feelings too...

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

πŸ“£ It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? πŸ’Έ

melvin-bot[bot] avatar Dec 23 '24 16:12 melvin-bot[bot]

I will review this week

allgandalf avatar Dec 24 '24 07:12 allgandalf

Proposal from @truph01 LGTM, their RCA is correct and solution should fix the mentioned bug.

πŸŽ€πŸ‘€πŸŽ€ C+ reviewed

allgandalf avatar Dec 27 '24 06:12 allgandalf

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

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

@danieldoglas, @CortneyOfstad, @allgandalf Whoops! This issue is 2 days overdue. Let's get this updated quick!

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

πŸ“£ It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? πŸ’Έ

melvin-bot[bot] avatar Dec 30 '24 16:12 melvin-bot[bot]

waiting for assignment

allgandalf avatar Dec 30 '24 20:12 allgandalf

@danieldoglas @CortneyOfstad @allgandalf this issue is now 4 weeks old, please consider:

  • Finding a contributor to fix the bug
  • Closing the issue if BZ has been unable to add the issue to a VIP or Wave project
  • If you have any questions, don't hesitate to start a discussion in #expensify-open-source

Thanks!

melvin-bot[bot] avatar Jan 01 '25 09:01 melvin-bot[bot]

@danieldoglas, @CortneyOfstad, @allgandalf Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

melvin-bot[bot] avatar Jan 03 '25 09:01 melvin-bot[bot]

@danieldoglas Could you help review this issue once you have a chance? Thanks

truph01 avatar Jan 03 '25 15:01 truph01

Assigned.

danieldoglas avatar Jan 03 '25 19:01 danieldoglas