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

Server notice rooms are created rapidly if triggered by maybe_send_server_notice_to_user #12686

@Half-Shot

Description

@Half-Shot

In the case where a server has reached it's MAU limit, the ResourceLimitsServerNotices class is meant to send a notice to users informing them of this. However, it ends up creating a ton of duplicate rooms and never actually invites the target for the notice to the room.

  • ServerNoticesManager.get_or_create_notice_room_for_user is used to create the room for the user but does not invite them, that happens in maybe_invite_user_to_room which is called together in send_notice
  • ResourceLimitsServerNotices is cheeky and calls ServerNoticesManager.get_or_create_notice_room_for_user in maybe_send_server_notice_to_user, presumably making the fatal mistake that get_or_create_notice_room_for_user does NOT invite users.
  • Hence, if your server is over the MAU limit, it's probably calling ResourceLimitsServerNotices.maybe_send_server_notice_to_user often, and therefore creating new rooms often.

This is causing some servers to bloat their database with empty rooms, and of course any interfaces polling the admin API for rooms will see a load of extra redundant rooms.

Metadata

Metadata

Assignees

Labels

S-MinorBlocks non-critical functionality, workarounds exist.T-DefectBugs, crashes, hangs, security vulnerabilities, or other reported issues.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions