Skip to content

[$250] Workspace - Workspace list doesn't get updated unless user opens workspace chat #46990

Closed

Description

@izarutskaya

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: 9.0.17-0
Reproducible in staging?: Y
Reproducible in production?: Y
Email or phone of affected tester (no customers): bezawitgebremichael+d1@gmail.com
Logs: https://stackoverflow.com/c/expensify/questions/4856
Issue reported by: Applause-Internal team

Action Performed:

  1. Prepare two different devices as this issue needs two devices to reproduce
  2. (Device 1) Navigate to staging.new.expensify.com and sign in with a brand new account
  3. (Device 1) Create one new workspace
  4. (Device 1) Go to inbox and open your space chat
  5. (Device 1) Navigate back to workspace list page
  6. (Device 1) Stay on workspace list page
  7. (Device 2) Sign in with the same account as device 1
  8. (Device 2) Navigate to workspace list page
  9. (Device 2) Click on "New workspace" to create a new workspace
  10. (Device 1) while on the workspace list page refresh the page
  11. (Device 1) Observe that the new created workspace doesn't appear on the workspace list
  12. (Device 1) Go to inbox and observe the newly created workspace chat appearing on inbox (But do not open the workspace chat page yet
  13. Go back to workspace list page and observe the new workspace still didn't appear
  14. Go back to inbox and open the workspace chat of the newly created workspace
  15. Go back to the workspace list page

Expected Result:

The newly created workspace appears on the workspace list after it being created

Actual Result:

The newly created workspace does not appear on the workspace list page on device 1 unless user navigates to the newly created workspace chat and opens it and then navigates back to the workspace list page

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

Bug6552712_1721914886958.bandicam_2024-07-25_16-13-32-930.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~0166c8776ce1f2455a
  • Upwork Job ID: 1825744773375033485
  • Last Price Increase: 2024-08-20
  • Automatic offers:
    • rayane-djouah | Reviewer | 103648162
Issue OwnerCurrent Issue Owner: @rayane-djouah

Activity

  1. added
    BugSomething is broken. Auto assigns a BugZero manager.
    on Aug 7, 2024
  2. melvin-bot commented on Aug 7, 2024

    @melvin-bot

    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.

  3. RachCHopkins commented on Aug 9, 2024

    @RachCHopkins
    Contributor

    Looks like the problem is:

    Mac 1 creates an account and creates a workspace and stays on the Settings > Workspaces page
    Mac 2 logs into that same account, creates an additional workspace
    Mac 1 refreshes and cannot see the workspace immediately

    We discourage users from sharing accounts, so I can't see that this is a real use bug, so there's no major urgency here.

    @izarutskaya can I please confirm that I must use 2 macs, or is it any 2 devices?

  4. melvin-bot commented on Aug 12, 2024

    @melvin-bot

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

  5. melvin-bot commented on Aug 14, 2024

    @melvin-bot

    @RachCHopkins Eep! 4 days overdue now. Issues have feelings too...

  6. melvin-bot commented on Aug 16, 2024

    @melvin-bot

    @RachCHopkins Still overdue 6 days?! Let's take care of this!

  7. bernhardoj commented on Aug 17, 2024

    @bernhardoj
    Contributor

    Proposal

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

    Workspace list doesn't get updated if we create the workspace from another device or OD.

    What is the root cause of that problem?

    When we create the workspace from another device or OD, the policy data doesn't have a role property, but shouldShowPolicy requires the policy to have a role, added in #44836.

    App/src/libs/PolicyUtils.ts

    Lines 169 to 175 in 67ad466

    function shouldShowPolicy(policy: OnyxEntry<Policy>, isOffline: boolean): boolean {
    return (
    !!policy &&
    (policy?.type !== CONST.POLICY.TYPE.PERSONAL || !!policy?.isJoinRequestPending) &&
    (isOffline || policy?.pendingAction !== CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE || Object.keys(policy.errors ?? {}).length > 0) &&
    !!policy?.role
    );

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

    Even though the policy doesn't have a role property, it does have a employeeList which contains the employee list with each of its role. So, we can use that as a fallback, just like we did for isPolicyAdmin.

    App/src/libs/PolicyUtils.ts

    Lines 186 to 187 in 67ad466

    const isPolicyAdmin = (policy: OnyxInputOrEntry<Policy>, currentUserLogin?: string): boolean =>
    (policy?.role ?? (currentUserLogin && policy?.employeeList?.[currentUserLogin]?.role)) === CONST.POLICY.ROLE.ADMIN;

    let currentUserLogin = '';
    Onyx.connect({
        key: ONYXKEYS.SESSION,
        callback: (val) => {
            currentUserLogin = val?.email ?? '';
        },
    });
    
    (!!policy?.role || !!policy?.employeeList?.[currentUserLogin]?.role)
    
  8. bernhardoj commented on Aug 17, 2024

    @bernhardoj
    Contributor

    is it any 2 devices?

    @RachCHopkins It's any 2 devices or creating the workspace from OD will cause this issue too. I once commented about this issue here.

  9. added
    ExternalAdded to denote the issue can be worked on by a contributor
    on Aug 20, 2024
  10. changed the title [-]Workspace - Workspace list doesn't get updated unless user opens workspace chat[/-] [+][$250] Workspace - Workspace list doesn't get updated unless user opens workspace chat[/+] on Aug 20, 2024
  11. melvin-bot commented on Aug 20, 2024

    @melvin-bot
  12. 16 remaining items

  13. bernhardoj commented on Aug 24, 2024

    @bernhardoj
    Contributor

    PR is ready

    I cover #44697 in the PR too.

    cc: @rayane-djouah

  14. RachCHopkins commented on Sep 9, 2024

    @RachCHopkins
    Contributor

    How's the review going @rayane-djouah?

  15. rayane-d commented on Sep 9, 2024

    @rayane-d
    Contributor

    Note

    The production deploy automation failed: This should be on [HOLD for Payment 2024-09-10] according to #48438 production deploy checklist, confirmed in #47958 (comment)

    cc @RachCHopkins

  16. rayane-d commented on Sep 10, 2024

    @rayane-d
    Contributor

    @RachCHopkins Payment is due today

  17. RachCHopkins commented on Sep 12, 2024

    @RachCHopkins
    Contributor

    @rayane-djouah I've just paid you. @bernhardoj I will send you an offer shortly!

  18. RachCHopkins commented on Sep 12, 2024

    @RachCHopkins
    Contributor

    Scratch that, sorry @bernhardoj I sent you an offer then retracted it, I just realised we pay you via NewDot.

    Payment Summary:

    Contributor: @bernhardoj to be paid $250 via NewDot Manual Request
    Contributor+: @rayane-djouah paid $250 via Upwork
    Upwork job here

  19. RachCHopkins commented on Sep 12, 2024

    @RachCHopkins
    Contributor

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

  20. bernhardoj commented on Sep 12, 2024

    @bernhardoj
    Contributor

    Requested in ND.

  21. JmillsExpensify commented on Sep 13, 2024

    @JmillsExpensify
    Contributor

    $250 approved for @bernhardoj

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.ExternalAdded to denote the issue can be worked on by a contributorReviewingHas a PR in reviewWeeklyKSv2

Type

No type

Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions