Skip to content
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

Closed
spantaleev opened this issue Jul 28, 2018 · 2 comments
Closed

Inviting users to groups is not idempotent and throws exceptions #3623

spantaleev opened this issue Jul 28, 2018 · 2 comments
Labels
S-Tolerable Minor significance, cosmetic issues, low or no impact to users. T-Defect Bugs, crashes, hangs, security vulnerabilities, or other reported issues.

Comments

@spantaleev
Copy link
Contributor

spantaleev commented Jul 28, 2018

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:

psycopg2.IntegrityError: duplicate key value violates unique constraint "group_invites_g_idx"

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 or storage/group_server.py) and how to swallow it from a deferred, I'm not sure.

@neilisfragile neilisfragile added z-p2 (Deprecated Label) z-minor (Deprecated Label) labels Aug 28, 2018
@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. and removed z-minor (Deprecated Label) z-p2 (Deprecated Label) labels Jul 26, 2021
@erikjohnston
Copy link
Member

(Though spaces will likely replace communities)

@clokep
Copy link
Member

clokep commented Apr 26, 2022

Communities/groups are being removed, see #11584.

@clokep clokep closed this as completed Apr 26, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
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

No branches or pull requests

5 participants