Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Logic for auto creating auto join rooms is brittle. #15813

Open
erikjohnston opened this issue Jun 21, 2023 · 1 comment
Open

Logic for auto creating auto join rooms is brittle. #15813

erikjohnston opened this issue Jun 21, 2023 · 1 comment
Labels
A-Create-Room O-Uncommon Most users are unlikely to come across this or unexpected workflow S-Tolerable Minor significance, cosmetic issues, low or no impact to users. T-Defect Bugs, crashes, hangs, security vulnerabilities, or other reported issues.

Comments

@erikjohnston
Copy link
Member

# try to create the room if we're the first real user on the server. Note
# that an auto-generated support or bot user is not a real user and will never be
# the user to create the room
should_auto_create_rooms = False
if (
self.hs.config.registration.autocreate_auto_join_rooms
and await self.store.is_real_user(user_id)
):
count = await self.store.count_real_users()
should_auto_create_rooms = count == 1
if should_auto_create_rooms:
await self._create_and_join_rooms(user_id)
else:
await self._join_rooms(user_id)

Problems include:

  1. If auto join is enabled after the first real user is created.
  2. Adding bots or support users will skip creating room, but will still try and join

We should change this to create the room if the room doesn't already exist, or something like that.

@erikjohnston erikjohnston added S-Tolerable Minor significance, cosmetic issues, low or no impact to users. T-Defect Bugs, crashes, hangs, security vulnerabilities, or other reported issues. O-Uncommon Most users are unlikely to come across this or unexpected workflow labels Jun 21, 2023
@vemmos
Copy link

vemmos commented Jun 25, 2023

Hey! Can you explain the scenario a bit ?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A-Create-Room O-Uncommon Most users are unlikely to come across this or unexpected workflow S-Tolerable Minor significance, cosmetic issues, low or no impact to users. T-Defect Bugs, crashes, hangs, security vulnerabilities, or other reported issues.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants