This repository has been archived by the owner on Apr 26, 2024. It is now read-only.
Inviting users to groups is not idempotent and throws exceptions #3623
Labels
S-Tolerable
Minor significance, cosmetic issues, low or no impact to users.
T-Defect
Bugs, crashes, hangs, security vulnerabilities, or other reported issues.
This is somewhat related to #2633 and caused by the changes done in #3128.
Currently, if a user is already invited to a group, subsequent invites (done with a
PUT
to/_matrix/client/r0/groups/<community-id>/admin/users/invite/<invitee-id>
) would return an HTTP 500 error and would spew some database exceptions in the logs, like:Since this is a
PUT
request, I believe the invitation handling should be idempotent and the API should just return the same response it returned the first time ({"state": "invited"}
or whatever).That is, the above exception (or rather
self.database_engine.module.IntegrityError
) can probably just get swallowed somewhere. Where that should go exactly (groups/groups_server.py
orstorage/group_server.py
) and how to swallow it from a deferred, I'm not sure.The text was updated successfully, but these errors were encountered: