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 2024-07-10] [$250] Workspace - Error page when navigate to Workspace Join link after leaving the workspace #43436

Closed
1 of 6 tasks
m-natarajan opened this issue Jun 10, 2024 · 41 comments
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

@m-natarajan
Copy link

m-natarajan commented Jun 10, 2024

If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!


Version Number: 1.4.81-1
Reproducible in staging?: y
Reproducible in production?: y
If this was caught during regression testing, add the test name, ID and link from TestRail: https://expensify.testrail.io/index.php?/tests/view/4609575&group_by=cases:section_id&group_order=asc&group_id=229065
Email or phone of affected tester (no customers):
Logs: https://stackoverflow.com/c/expensify/questions/4856
Expensify/Expensify Issue URL:
Issue reported by: applause internal team
Slack conversation:

Action Performed:

  1. Login to staging.expensify.com
  2. Navigate to this link - https://staging.new.expensify.com/settings/workspaces/CEFA9CA2E2CBFFC0/join?email=applausetester+joinlink@applause.expensifail.com
  3. Click on 3-dot menu> Leave
  4. Navigate to this link again - https://staging.new.expensify.com/settings/workspaces/CEFA9CA2E2CBFFC0/join?email=applausetester+joinlink@applause.expensifail.com

Expected Result:

User should be able to navigate to the workspace

Actual Result:

Error page when navigate to Workspace Join link after leaving the workspace

Workaround:

unknown

Platforms:

Which of our officially supported platforms is this issue occurring on?

  • Android: Native
  • Android: mWeb Chrome
  • iOS: Native
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Bug6508578_1718048869729.Recording__3163.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~0191daed4e48342857
  • Upwork Job ID: 1800535491968568315
  • Last Price Increase: 2024-06-25
  • Automatic offers:
    • allgandalf | Reviewer | 102892807
    • bernhardoj | Contributor | 102892809
Issue OwnerCurrent Issue Owner: @isabelastisser
@m-natarajan m-natarajan added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Jun 10, 2024
Copy link

melvin-bot bot commented Jun 10, 2024

Triggered auto assignment to @isabelastisser (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.

@m-natarajan
Copy link
Author

@isabelastisser FYI I haven't added the External label as I wasn't 100% sure about this issue. Please take a look and add the label if you agree it's a bug and can be handled by external contributors

@bernhardoj
Copy link
Contributor

Proposal

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

The not found page is shown when we reopen the workspace join link after leaving it.

What is the root cause of that problem?

When we successfully leave from a workspace, we still keep the policy object data. It's really weird that the pending action is still delete.

const successData: OnyxUpdate[] = [
{
onyxMethod: Onyx.METHOD.MERGE,
key: `${ONYXKEYS.COLLECTION.POLICY}${policyID}`,
value: {
pendingAction: CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE,
employeeList: {
[sessionEmail]: null,
},
},
},
];

When we reopen the join link/page, the condition below detects that the workspace exists, thus we are navigated to the profile page.

if (!isEmptyObject(policy) && !policy?.isJoinRequestPending) {
Navigation.isNavigationReady().then(() => {
Navigation.goBack(undefined, false, true);
Navigation.navigate(ROUTES.WORKSPACE_INITIAL.getRoute(policyID ?? ''));
});
return;
}

The not found page will be shown if the policy/workspace has a pending action of delete, thus we see the not found page.

(PolicyUtils.isPendingDeletePolicy(policy) && PolicyUtils.isPendingDeletePolicy(prevPolicy))

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

First, we should clear the policy data after successfully leaving a workspace.

const successData: OnyxUpdate[] = [
    {
        onyxMethod: Onyx.METHOD.MERGE,
        key: `${ONYXKEYS.COLLECTION.POLICY}${policyID}`,
        value: null,
    },
];

Next, because not found page will be shown for pending delete workspace, we need to add a new check here to make sure the pending action is not delete so we don't get navigated to the not found workspace profile page.

if (!isEmptyObject(policy) && !policy?.isJoinRequestPending) {
Navigation.isNavigationReady().then(() => {
Navigation.goBack(undefined, false, true);
Navigation.navigate(ROUTES.WORKSPACE_INITIAL.getRoute(policyID ?? ''));
});
return;
}

if (!isEmptyObject(policy) && !policy?.isJoinRequestPending && !PolicyUtils.isPendingDeletePolicy(policy)) {

We can optionally check for the policy ID. Let me know if we want to do that

@isabelastisser isabelastisser added External Added to denote the issue can be worked on by a contributor Help Wanted Apply this label when an issue is open to proposals by contributors labels Jun 11, 2024
@melvin-bot melvin-bot bot changed the title Workspace - Error page when navigate to Workspace Join link after leaving the workspace [$250] Workspace - Error page when navigate to Workspace Join link after leaving the workspace Jun 11, 2024
Copy link

melvin-bot bot commented Jun 11, 2024

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

Copy link

melvin-bot bot commented Jun 11, 2024

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

@isabelastisser
Copy link
Contributor

@abdulrahuman5196, can you please review the proposal above? Thanks!

@melvin-bot melvin-bot bot added the Overdue label Jun 14, 2024
Copy link

melvin-bot bot commented Jun 14, 2024

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

@isabelastisser
Copy link
Contributor

isabelastisser commented Jun 17, 2024

@abdulrahuman5196 please review the proposal above. Thanks!

@isabelastisser
Copy link
Contributor

@abdulrahuman5196, please provide an update. Thanks!

Copy link

melvin-bot bot commented Jun 18, 2024

📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸

@abdulrahuman5196
Copy link
Contributor

Hi, @isabelastisser I am back now since I was OOO for couple of days as posted in slack. Will work on review today.

@melvin-bot melvin-bot bot removed the Overdue label Jun 18, 2024
@abdulrahuman5196
Copy link
Contributor

checking now

@abdulrahuman5196
Copy link
Contributor

Navigate to this link - https://staging.new.expensify.com/settings/workspaces/CEFA9CA2E2CBFFC0/join?email=applausetester+joinlink@applause.expensifail.com

Hi @isabelastisser / @bernhardoj , this link is only setting the workspace as Requested, how do I generate this link or use it for testing?

Screenshot 2024-06-20 at 8 48 38 PM

@bernhardoj
Copy link
Contributor

@abdulrahuman5196 I use my other account workspace invitation. So, I get my account B workspace join link, account A opens it, and account B accepts the request (in #admins room if I'm not mistaken).

Copy link

melvin-bot bot commented Jun 24, 2024

@isabelastisser @abdulrahuman5196 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 melvin-bot bot added the Overdue label Jun 24, 2024
Copy link

melvin-bot bot commented Jun 25, 2024

📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸

@isabelastisser
Copy link
Contributor

@abdulrahuman5196, please share an update. Thanks!

Copy link

melvin-bot bot commented Jun 25, 2024

@isabelastisser, @abdulrahuman5196 Huh... This is 4 days overdue. Who can take care of this?

@isabelastisser
Copy link
Contributor

@abdulrahuman5196 I DM'd you for visibility.

@melvin-bot melvin-bot bot removed the Overdue label Jun 26, 2024
@isabelastisser
Copy link
Contributor

@allgandalf, did you have a chance to review the PR?

@allgandalf
Copy link
Contributor

sorry i didn't update here, the PR was already merged :)

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels Jul 3, 2024
@melvin-bot melvin-bot bot changed the title [$250] Workspace - Error page when navigate to Workspace Join link after leaving the workspace [HOLD for payment 2024-07-10] [$250] Workspace - Error page when navigate to Workspace Join link after leaving the workspace Jul 3, 2024
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Jul 3, 2024
Copy link

melvin-bot bot commented Jul 3, 2024

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

Copy link

melvin-bot bot commented Jul 3, 2024

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

If no regressions arise, payment will be issued on 2024-07-10. 🎊

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

Copy link

melvin-bot bot commented Jul 3, 2024

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:

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

@isabelastisser
Copy link
Contributor

@allgandalf, please complete the checklist above. Thanks!

@bernhardoj
Copy link
Contributor

Just FYI, I will request the payment through ND.

@allgandalf
Copy link
Contributor

Regression Test Proposal

  1. [User B] Copy a workspace join link that User A is not a member
  2. [User A] Open the workspace join link
  3. [User B] Accept the join request from #admins room
  4. [User A] Leave the workspace
  5. [User A] (iOS/Android) Close the app
  6. [User A] Open the workspace join link again
  7. Verify workspace list page is shown
  8. Verify the join request is sent again

Do we agree 👍 or 👎

@bernhardoj
Copy link
Contributor

Requested in ND

@isabelastisser
Copy link
Contributor

Payment summary:

@bernhardoj contributor / $250 / pending in NewDot
@allgandalf C+ review / $250 / paid in Upwork

@isabelastisser
Copy link
Contributor

@AndrewGable can you please review the regression test proposal? thanks!

@isabelastisser isabelastisser added Daily KSv2 and removed Weekly KSv2 labels Jul 10, 2024
@JmillsExpensify
Copy link

$250 approved for @bernhardoj

@melvin-bot melvin-bot bot added Daily KSv2 Overdue and removed Daily KSv2 labels Jul 10, 2024
@isabelastisser
Copy link
Contributor

@melvin-bot melvin-bot bot added Overdue and removed Overdue labels Jul 12, 2024
@AndrewGable
Copy link
Contributor

Yes, looks good

@isabelastisser
Copy link
Contributor

All set!

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
No open projects
Archived in project
Development

No branches or pull requests

7 participants