App: [$500] MEDIUM: Allow arbitrary users to be added/removed to/from workspace chat via @mention or members list

Problem:

Right now there are no possibilities to add anyone to the automatically created workspace chats, but it should be possible to add by “mention”; it’s similarly not possible to remove someone who has been thus added.

Solution:

As discussed here, we would like to add this possibility to:

  1. Allow anyone to be added to the workspace chat via @mention
  2. Allow anyone to be added to the workspace chat via the Invite button of the members page
  3. Allow anybody who wasn’t auto-added (ie, admins or the employee) to be removed via the members page

IMPORTANT details for workspace chats:

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~013623b6c6ce0881ae
  • Upwork Job ID: 1753488042510364672
  • Last Price Increase: 2024-04-12
  • Automatic offers:
    • brunovjk | Contributor | 0

About this issue

  • Original URL
  • State: open
  • Created 5 months ago
  • Comments: 45 (32 by maintainers)

Most upvoted comments

@brunovjk I think I prefer your alternative solution, the RoomMembersPage is intended to be used to manage the members for all types of reports, can you update your proposal to elaborate the specific changes you’d make for your alternative solution to work?

Nice @ jasperhuangg!! There are 3 similar issues that I believe were resolved by your PR:

  1. #40459
  2. #40301
  3. #37970

However, the problem persists when we add unknown users to a public-room or workspace-chat-room via Invite button (The latter you can only test using our PR)

I’ll wait a few more days and test again. Last test: 04/29

I am not sure if this needs to be fixed from BE. @jasperhuangg Can you comment?

We just don’t do anything in RoomMembersPage when dealing with user (accountID) without personalDetails https://github.com/Expensify/App/blob/db9e01cc302df7f2b3dd53a99c1082404676aedb/src/pages/RoomMembersPage.tsx#L173-L175

I believe that the ideal would be to fix it via the backend, the BE should retrieve and return the updated personal details data. However we can update this logic in the FE to deal with users without personalDetails anyway.

Thank you for the review @jasperhuangg, can you please check again?

Mention invites in workspace chats is indeed working, but I haven’t managed to get default chats, #announce and #admins , yet.

That’s expected. You aren’t supposed to be able to invite people to default rooms. This issue only pertains to workspace chats, so there’s no need to worry about adding the invite page to default rooms.

The back-end has already been updated to support mention invites in workspace chats, fyi

Just got it. Thanks for clarifying. I agree using the RoomMembersPage.

Proposal

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

Allow arbitrary users to be added/removed to/from workspace chat via @mention or members list

What is the root cause of that problem?

When we access “Members” on the “Detail Page” in a “Workspace chat”, we navigate to a participant page, which does not allow us to “Invite” or “Remove” members.

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

  1. Allow anyone to be added to the workspace chat via @mention

    The back-end has already been updated to support mention invites in workspace chats #comment

  2. Allow anyone to be added to the workspace chat via the Invite button of the members page

    Using the RoomMembersPage instead of ReportParticipantsPage Add a isPolicyExpenseChat check here: https://github.com/Expensify/App/blob/dd30d137b485482bb8e4c61700b58d2e03683124/src/pages/ReportDetailsPage.tsx#L137

    if (isUserCreatedPolicyRoom || isChatThread || isPolicyExpenseChat) {
    
  3. Allow anybody who wasn’t auto-added (ie, admins or the employee) to be removed via the members page

    It’s working with the changes above.

What alternative solutions did you explore? (Optional)

N/A

This was just opened up to FE contributors last week. I’m going to keep this at Daily and start bumping Slack channels this week to get some proposals.

Gonna bump this to Daily

Quick update, Auth PR is on HOLD for the Web-E^ to go out to production. It’s on staging right now