Skip to content

HIGH: [Reliability] "Auth DeletePolicy" error occurs when deleting a workspace connected to a room #20860

Closed

Description

@kavimuru

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. Log in to user1 account
  2. Go to Settings > Workspaces and create a new workspace
  3. Invite user2 to join the newly created workspace
  4. Log in to user2 account
  5. Navigate to the New Room section
  6. Create a room and select workspace created by user1 and select room's visibility to public
  7. Switch back to user1 account
  8. Attempt to delete the workspace

Expected Result:

Auth error should not appear while deleting workspace

Actual Result:

"Auth DeletePolicy" error occurs when deleting a workspace connected to a room

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.28-3
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

2023-06-02-01-15-30_334ydcC2.mp4
Recording.981.mp4

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

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01e90bc248e9218d8a
  • Upwork Job ID: 1669695619332808704
  • Last Price Increase: 2023-07-07

Activity

  1. added
    BugSomething is broken. Auto assigns a BugZero manager.
    on Jun 15, 2023
  2. melvin-bot commented on Jun 15, 2023

    @melvin-bot

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

  3. melvin-bot commented on Jun 15, 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
  4. joekaufmanexpensify commented on Jun 16, 2023

    @joekaufmanexpensify
    Contributor

    Reproduced. I also noted this doesn't happen with other room types (like restricted).

  5. changed the title [-] "Auth DeletePolicy" error occurs when deleting a workspace connected to a room[/-] [+][$1000] "Auth DeletePolicy" error occurs when deleting a workspace connected to a room[/+] on Jun 16, 2023
  6. melvin-bot commented on Jun 16, 2023

    @melvin-bot
  7. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on Jun 16, 2023
  8. melvin-bot commented on Jun 16, 2023

    @melvin-bot

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

  9. melvin-bot commented on Jun 16, 2023

    @melvin-bot

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

  10. wildan-m commented on Jun 17, 2023

    @wildan-m
    Contributor

    Proposal

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

    "Auth DeletePolicy" error occurs when deleting a workspace connected to a room

    What is the root cause of that problem?

    When the visibility is set to private or public then, policyOwner is not added as a room participant. When we choose Restricted visibility, all workspace members are included.

    This will cause room not found when we perform DeleteWorkspace API request.

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

    Ideally, if we execute DeleteWorkspace API by the policyOwner, it should find the room id even if the policy owner is not added to the room as a participant. So we should modify DeleteWorkspace API to be able to find all of the owned room ids.

    What alternative solutions did you explore? (Optional)

    We can add all members to the room for all of the visibility types like what we did for the Restrict visibility type, or at least we can add the policy owner to the new room as a participant.

    We should also modify the backend for this option, and then add ownerAccountID to participants for optimistic report creation.

    From this:

    App/src/libs/actions/Report.js

    Lines 1156 to 1159 in 83ab016

    function addPolicyReport(policy, reportName, visibility) {
    // The participants include the current user (admin) and the employees. Participants must not be empty.
    const participants = _.unique([currentUserAccountID, ..._.pluck(policy.employeeList, 'accountID')]);
    const policyReport = ReportUtils.buildOptimisticChatReport(

    To this:

    function addPolicyReport(policy, reportName, visibility) {
        const ownerAccountID = PersonalDetailsUtils.getAccountIDsByLogins([policy.owner])[0];
        // The participants include the current user (admin) and the employees. Participants must not be empty.
        const participants = _.unique([ownerAccountID, currentUserAccountID, ..._.pluck(policy.employeeList, 'accountID')]);
    

    Or we can also pass the participants from the API call.

  11. 134 remaining items

  12. quinthar commented on Feb 25, 2024

    @quinthar
    Contributor

    Escalating to HIGH so we can get more discussion on this.

  13. changed the title [-] "Auth DeletePolicy" error occurs when deleting a workspace connected to a room[/-] [+]HIGH: "Auth DeletePolicy" error occurs when deleting a workspace connected to a room[/+] on Feb 25, 2024
  14. moved this from LOW to HIGH in [#whatsnext] #vip-vsbon Feb 25, 2024
  15. quinthar commented on Feb 25, 2024

    @quinthar
    Contributor
  16. joekaufmanexpensify commented on Mar 4, 2024

    @joekaufmanexpensify
    Contributor

    Great. TY!

  17. joekaufmanexpensify commented on Mar 22, 2024

    @joekaufmanexpensify
    Contributor

    Going to work on seeing if this issue is reproducible!

  18. changed the title [-]HIGH: "Auth DeletePolicy" error occurs when deleting a workspace connected to a room[/-] [+]HIGH: [Reliability] "Auth DeletePolicy" error occurs when deleting a workspace connected to a room[/+] on Mar 25, 2024
  19. joekaufmanexpensify commented on Mar 25, 2024

    @joekaufmanexpensify
    Contributor

    Just retested this, and it's working now! If you create a public room on a workspace and then delete the workspace, you can now successfully delete it, and the public room is just archived.

  20. joekaufmanexpensify commented on Mar 25, 2024

    @joekaufmanexpensify
    Contributor

    Closing as the reported bug is no longer occurring!

  21. ayazhussain79 commented on Mar 26, 2024

    @ayazhussain79
    Contributor

    @joekaufmanexpensify could you please check, this bug was reported Jun 16, 2023 before closing the bug reporting, so I'm eligible for bug reporting right?

  22. joekaufmanexpensify commented on Mar 26, 2024

    @joekaufmanexpensify
    Contributor

    No, I don't think so. We didn't fix anything in this issue.

  23. ayazhussain79 commented on Mar 26, 2024

    @ayazhussain79
    Contributor

    Ok Thank you

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

Metadata

Metadata

Labels

BugSomething is broken. Auto assigns a BugZero manager.EngineeringFirstPickEngineering only, please! Only add when there is an identified code solution.InternalRequires API changes or must be handled by Expensify staffMonthlyKSv2

Type

No type

Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions