Skip to content

Room - 'No workspace found' page is not displayed when user navigates to room #34253

Closed

Description

@lanitochka17

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.24-0
Reproducible in staging?: Y
Reproducible in production?: N
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
Expensify/Expensify Issue URL:
Issue reported by: Applause - Internal Team
Slack conversation:

Action Performed:

  1. Sign up with a new account & verify that you are not a member of any workspace
  2. Click on 'FAB' menu > click on 'Start Chat'
  3. Click on 'Room'

Expected Result:

'No workspace found' page should be displayed

Actual Result:

User is navigated to 'Create room' page but is unable to create. a room

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

Add any screenshot/video evidence

Bug6337845_1704901616647.Screen_Recording_2024-01-10_at_2.55.02_in_the_afternoon__1_.mp4

View all open jobs on GitHub

Activity

  1. github-actions commented on Jan 10, 2024

    @github-actions
    Contributor

    👋 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.
  2. melvin-bot commented on Jan 10, 2024

    @melvin-bot

    Triggered auto assignment to @cead22 (Engineering), see https://stackoverflow.com/c/expensify/questions/4319 for more details.

  3. paultsimura commented on Jan 10, 2024

    @paultsimura
    Contributor

    Proposal

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

    What is the root cause of that problem?

    The default "{user}'s Expenses" workspace is now present in Onyx for the newly created users:

    image

    And it is not filtered out when building the list of workspaces available for room creation.

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

    If we don't want to allow to create rooms in it, we should filter out the default "{user}'s Expenses" workspace here:

    const workspaceOptions = useMemo(
    () =>
    _.map(PolicyUtils.getActivePolicies(props.policies), (policy) => ({
    label: policy.name,
    key: policy.id,
    value: policy.id,
    })),
    [props.policies],
    );

    Similar to how we decide whether the Policy should be present in the User's policies list:

    /**
    * Check if the policy can be displayed
    * If offline, always show the policy pending deletion.
    * If online, show the policy pending deletion only if there is an error.
    * Note: Using a local ONYXKEYS.NETWORK subscription will cause a delay in
    * updating the screen. Passing the offline status from the component.
    */
    function shouldShowPolicy(policy: OnyxEntry<Policy>, isOffline: boolean): boolean {
    return (
    !!policy &&
    policy?.isPolicyExpenseChatEnabled &&
    policy?.role === CONST.POLICY.ROLE.ADMIN &&
    (isOffline || policy?.pendingAction !== CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE || Object.keys(policy.errors ?? {}).length > 0)
    );
    }

    What alternative solutions did you explore? (Optional)

    We can partially revert de0a96b by bringing back the policy.isPolicyExpenseChatEnabled check into getActivePolicies function.

  4. dukenv0307 commented on Jan 10, 2024

    @dukenv0307
    Contributor

    Proposal

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

    User is navigated to 'Create room' page but is unable to create. a room

    What is the root cause of that problem?

    BE returns the default policy of the user. So the workspace option is not empty here

    _.map(PolicyUtils.getActivePolicies(props.policies), (policy) => ({

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

    If we only want to create a room for the workspace which is displayed in WorkspaceListPage, we can use PolicyUtils.shouldShowPolicy to filter out the workspace options here. This will be consistent with the list workspaces which we show in the WorkspaceListPage

    _.map(PolicyUtils.getActivePolicies(props.policies), (policy) => ({

    What alternative solutions did you explore? (Optional)

    NA

  5. paultsimura commented on Jan 10, 2024

    @paultsimura
    Contributor

    BTW, this is a regression from #34046
    cc: @iwiznia

  6. iwiznia commented on Jan 10, 2024

    @iwiznia
    Contributor

    Huh? Why/how? Ohhhhh, is it because we are not creating the chats for the admin? Basically what @Julesssss pointed out here?

  7. paultsimura commented on Jan 10, 2024

    @paultsimura
    Contributor

    Yes. We should have kept the policy.isPolicyExpenseChatEnabled check here:

    image

    We are still keeping this check when deciding whether the Workspace should be visible on Profile -> Workspaces page:

    /**
    * Check if the policy can be displayed
    * If offline, always show the policy pending deletion.
    * If online, show the policy pending deletion only if there is an error.
    * Note: Using a local ONYXKEYS.NETWORK subscription will cause a delay in
    * updating the screen. Passing the offline status from the component.
    */
    function shouldShowPolicy(policy: OnyxEntry<Policy>, isOffline: boolean): boolean {
    return (
    !!policy &&
    policy?.isPolicyExpenseChatEnabled &&
    policy?.role === CONST.POLICY.ROLE.ADMIN &&
    (isOffline || policy?.pendingAction !== CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE || Object.keys(policy.errors ?? {}).length > 0)
    );
    }

  8. iwiznia commented on Jan 10, 2024

    @iwiznia
    Contributor

    Well that kind of defeats the purpose of the PR... I think we need to do what @Julesssss suggested in the backend, but waiting for him to double check.

  9. Julesssss commented on Jan 10, 2024

    @Julesssss
    Contributor

    I think you mean @mountiny.

    Just noting that the UI issue reminds me of this bug.

  10. iwiznia commented on Jan 10, 2024

    @iwiznia
    Contributor

    Damnit! Sorry about that. I swear it's your avatars, they look too similar for my shitty ill working eyes 😂

  11. cead22 commented on Jan 11, 2024

    @cead22
    Contributor

    Looks like we're waiting on Vit to confirm, and this might need a backend fix. @iwiznia I assigned you since you'll be on before me tomorrow, and you seem to be familiar with this issue

  12. thienlnam commented on Jan 11, 2024

    @thienlnam
    Contributor

    Should we revert that PR for the meantime so we can continue with deploy? Seems like reverting will just require you to create a workspace and that works as intended - so seems like we should go with that for now and then we can figure out what changes are required later

  13. thienlnam commented on Jan 11, 2024

    @thienlnam
    Contributor

    Ended up reverting it #34311 - which actually ended up overlapping with another TS change that was merged to main that I fixed here

  14. added and removed
    DeployBlockerCashThis issue or pull request should block deployment
    on Jan 11, 2024
  15. iwiznia commented on Jan 11, 2024

    @iwiznia
    Contributor

    So can we close this now that it was reverted?

  16. thienlnam commented on Jan 12, 2024

    @thienlnam
    Contributor

    Yeah, we can close this since this bug no longer exists and then move the convo to the original issue

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

Metadata

Metadata

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions