RocketChat / RocketChat/Rocket.Chat
Discussion creation from `pmid` auto invites deactivated message authors
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 46.1k
- Forks
- 13.9k
- Avg merge
- 3d 3h
- Merged PRs (30d)
- 130
Description
Description
When creating a discussion from a message (rooms.createDiscussion with pmid), the original message author is automatically included in the invite list.
Currently, this auto-invite path does not check whether that user is deactivated.
Current behavior
In apps/meteor/app/discussion/server/methods/createDiscussion.ts, the invite list is built as:
message ? [message.u.username, ...users] : users
This means the message author is included even if active: false.
Expected behavior
Deactivated users should not be auto invited when creating discussions from a message.
If a username is deactivated, it should be filtered out before room creation.
Why this matters
- Keeps membership behavior consistent with “active users only” expectations.
- Avoids attempts to include inactive accounts in new discussion participants.
- Reduces edge case permission/subscription inconsistencies.
Minimal reproduction
- Create user
u1and ensure they can post in a channel. u1sends a message in channelC.- Deactivate
u1(users.setActiveStatus,activeStatus: false). - Another active user creates a discussion from
u1’s message (pmidset). - Observe that
u1is currently considered for auto-invite.
Suggested fix
In discussion creation flow:
- Build candidate usernames (
message author + users[]). - Resolve usernames to active users only.
- Pass only active usernames to
createRoom.
Acceptance criteria
- Deactivated message authors are not auto-invited to newly created discussions.
- Deactivated usernames in
users[]are ignored. - Add an end-to-end test under
/rooms.createDiscussioncovering this case.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in apps/meteor/app/discussion/server/methods/createDiscussion.ts and trace the /rooms.createDiscussion flow for pmid and users. Add or update the end-to-end test under /rooms.createDiscussion to cover a deactivated message author and deactivated usernames in users[]. Done means inactive users are excluded from newly created discussion invites.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- api, backend, testing
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 68/100