RocketChat / RocketChat/Rocket.Chat

Apps engine: No way to see what users are in a room when it is first created

Open
#35,000 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Feature: Request planned
Dominant language
TypeScript
Stars
46.1k
Forks
13.9k
Avg merge
3d 3h
Merged PRs (30d)
130

Description

Description:

In the app engine, there is no way to tell what users are in a room when the room is first created, because the executePostRoomUser function is not executed, and the executePostRoomCreate IRoom object doesn't have any "userIds" property.

Steps to reproduce:
  1. Add the following handlers in the app engine:
    public executePostRoomUserJoined(context: IRoomUserJoinedContext, read: IRead, http: IHttp, persistence: IPersistence, modify: IModify): Promise<void> {
        this.getLogger().debug(context);
        return Promise.resolve(undefined);
    }
    public executePostRoomCreate(room: IRoom, read: IRead, http: IHttp, persistence: IPersistence, modify: IModify): Promise<void> {
        this.getLogger().debug(room);
        return Promise.resolve(undefined);
    }
  1. Create a channel with an initial set of users
  2. Check the app log and notice that the "room" object logged in executePostRoomCreate has no users, and there is no "executePostRoomUserJoined" log message.
Expected behavior:

Either one of the following:

  1. the executePostRoomUserJoined function will execute after the room is created with multiple users
  2. the executePostRoomCreate function will execute and contain the "userIds" property in the room object
Actual behavior:

the "room" object logged in executePostRoomCreate has no users, and there is no "executePostRoomUserJoined" log message.

Server Setup Information:
  • Version of Rocket.Chat Server: Version 7.2.1
  • License Type: Starter
  • Number of Users: 2
  • Operating System: WSL
  • Deployment Method: docker compose
  • Number of Running Instances: 1
  • DB Replicaset Oplog:
  • NodeJS Version:
  • MongoDB Version:
Client Setup Information
  • Desktop App or Browser Version:
  • Operating System:
Additional context

I want to be able to know what users are in a room when it is first created.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the app-engine entry points executePostRoomCreate and executePostRoomUserJoined, then trace room creation and how the IRoom object is populated. Reproduce the case with a newly created channel and multiple initial users. Done means the initial users are observable through one of the documented behaviors without breaking room creation events.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
api, backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.