Skip to content

[HOLD for payment 2023-04-10][Workspace Chats] Name of the workspace does not appear as the preview row in the search results for the admin #16463

Closed

Description

@trjExpensify

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:

prerequisite: you must be using an account that's on the policyExpenseChat beta

  1. Go to new.expensify.com
  2. Click the green + icon FAB > New workspace
  3. Navigate to the Manager members tab of the workspace settings
  4. Click Invite and enter a valid email address to invite a new member to the workspace
  5. CMD+K to bring up the search/chat switcher page

Expected Result:

As an admin, the workspace chat in the search results should have the primaryLogin (or fullName) as the first row, and the name of the workspace as the second row. I.e

tom@trj.chat
Mills' Mills workspace 

Actual Result:

The workspace chat in the search results displays an empty preview from the member as the second row on creation. I.e

tom@trj.chat
tom@trj.chat: 

Workaround:

N/A beta feature

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: v1.2.87-1
Reproducible in staging?:
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): tom+wcrun20@trj.chat
Logs: https://stackoverflow.com/c/expensify/questions/4856
Notes/Photos/Videos: Any additional supporting documentation

image

image (excuse the old mock)

Expensify/Expensify Issue URL:
Issue reported by: @trjExpensify
Slack conversation: https://expensify.slack.com/archives/C02HWMSMZEC/p1679607461290709?thread_ts=1679329747.036069&cid=C02HWMSMZEC

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~018cb101c0281722e5
  • Upwork Job ID: 1639025649633243136
  • Last Price Increase: 2023-03-28

Activity

  1. added
    InternalRequires API changes or must be handled by Expensify staff
    BugSomething is broken. Auto assigns a BugZero manager.
    on Mar 23, 2023
  2. MelvinBot commented on Mar 23, 2023

    @MelvinBot
    Contributor

    Current assignee @trjExpensify is eligible for the Bug assigner, not assigning anyone new.

  3. MelvinBot commented on Mar 23, 2023

    @MelvinBot
    Contributor
  4. MelvinBot commented on Mar 23, 2023

    @MelvinBot
    Contributor

    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
  5. MelvinBot commented on Mar 23, 2023

    @MelvinBot
    Contributor

    Triggered auto assignment to Contributor Plus for review of internal employee PR - @0xmiroslav (Internal)

  6. BeeMargarida commented on Mar 24, 2023

    @BeeMargarida
    Contributor

    Hi, Ana from Callstack, I can work on this issue

  7. BeeMargarida commented on Mar 27, 2023

    @BeeMargarida
    Contributor

    Proposal

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

    When searching for chats using Cmd+K, the preview of the Policy expense chats does not show the name of the workspace. The expected behaviour would be to show the name of the workspace for the admin and the last message for the member.

    What is the root cause of that problem?

    Currently there is no check to see if the user is the admin of the policy expense chat when building the chat preview for the search sidebar.

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

    The logic regarding the preview building for the search is in OptionsListUtils.js. Each report is iterated and the function createOption is called here with the prop forcePolicyNamePreview that controls if the chat preview shows the name of the policy workspace or the last message (if possible).

    I suggest changing this part of the code to something like

    const isOwner = ReportUtils.isPolicyExpenseChatAdmin(report, policies);
    
    allReportOptions.push(createOption(logins, personalDetails, report, reportActions, {
        showChatPreviewLine,
        forcePolicyNamePreview: isPolicyExpenseChat ? isSearchingSomeonesPolicyExpenseChat || isOwner : forcePolicyNamePreview,
    }));

    The isPolicyExpenseChatAdmin is a new function that verifies if the current user is the admin of the policy and would be something like:

    function isPolicyExpenseChatAdmin(report, policies) {
      if (!isPolicyExpenseChat(report)) {
          return false;
      }
    
      const policy = policies[`${ONYXKEYS.COLLECTION.POLICY}${report.policyID}`];
      if (!policy) {
          return false;
      }
    
      return policy ? policy.owner === currentUserEmail : false;
    }

    What alternative solutions did you explore? (Optional)

    N/A

  8. 26 remaining items

  9. changed the title [-][HOLD for payment 2023-04-07] [Workspace Chats] Name of the workspace does not appear as the preview row in the search results for the admin[/-] [+][HOLD for payment 2023-04-10] [HOLD for payment 2023-04-07] [Workspace Chats] Name of the workspace does not appear as the preview row in the search results for the admin[/+] on Apr 3, 2023
  10. MelvinBot commented on Apr 3, 2023

    @MelvinBot
    Contributor

    The solution for this issue has been 🚀 deployed to production 🚀 in version 1.2.93-4 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 2023-04-10. 🎊

    After the hold period is over and BZ checklist items are completed, please complete any of the applicable payments for this issue, and check them off once done.

    • External issue reporter
    • Contributor that fixed the issue
    • Contributor+ that helped on the issue and/or PR

    As a reminder, here are the bonuses/penalties that should be applied for any External issue:

    • Merged PR within 3 business days of assignment - 50% bonus
    • Merged PR more than 9 business days after assignment - 50% penalty
  11. MelvinBot commented on Apr 3, 2023

    @MelvinBot
    Contributor

    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:

    • [@0xmiroslav / @mountiny] The PR that introduced the bug has been identified. Link to the PR:
    • [@0xmiroslav / @mountiny] 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:
    • [@0xmiroslav / @mountiny] 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:
    • [@trjExpensify] Determine if we should create a regression test for this bug.
    • [@0xmiroslav] 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.
    • [@trjExpensify] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:
  12. changed the title [-][HOLD for payment 2023-04-10] [HOLD for payment 2023-04-07] [Workspace Chats] Name of the workspace does not appear as the preview row in the search results for the admin[/-] [+][HOLD for payment 2023-04-10][Workspace Chats] Name of the workspace does not appear as the preview row in the search results for the admin[/+] on Apr 3, 2023
  13. MelvinBot commented on Apr 10, 2023

    @MelvinBot
    Contributor

    @trjExpensify, @BeeMargarida, @mountiny, @0xmiroslav Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

  14. MelvinBot commented on Apr 10, 2023

    @MelvinBot
    Contributor

    @trjExpensify, @BeeMargarida, @mountiny, @0xmiroslav Whoops! This issue is 2 days overdue. Let's get this updated quick!

  15. trjExpensify commented on Apr 11, 2023

    @trjExpensify
    ContributorAuthor

    👋 Melv, I'm back from OoO today. @0xmiroslav, I've sent you a contract for the C+ review.

    [@0xmiroslav / @mountiny] The PR that introduced the bug has been identified. Link to the PR:
    [@0xmiroslav / @mountiny] 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:

    @BeeMargarida fixed the regression and was the author of #15895 which introduced it, so no action needed here! 😄 Checked them off.

    As for these:

    [@0xmiroslav / @mountiny] 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:
    [@trjExpensify] Determine if we should create a regression test for this bug.
    [@0xmiroslav] 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.
    [@trjExpensify] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:

    We're in the process of adding the overarching workspace chats regression test suite, and this is covered in them, so no specific action is needed to add anything else. Checked them off!

  16. trjExpensify commented on Apr 11, 2023

    @trjExpensify
    ContributorAuthor

    Settled up!

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

Metadata

Metadata

Labels

Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.DailyKSv2ExternalAdded to denote the issue can be worked on by a contributor

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions