Former room owners leaving room, inviting others #69

Closed
opened 2023-11-29 14:17:01 +01:00 by HueHe · 2 comments
Contributor

If a room owner left the room at some point and someone needs to be invited, the script crashes with a Response: 403 {"errcode":"M_FORBIDDEN","error":"@[former room owner] not in room ![room]."}

Probably the admin should invite as a fallback.

If a room owner left the room at some point and someone needs to be invited, the script crashes with a `Response: 403 {"errcode":"M_FORBIDDEN","error":"@[former room owner] not in room ![room]."}` Probably the admin should invite as a fallback.
HueHe referenced this issue from a commit 2023-11-29 14:47:46 +01:00
Author
Contributor

The admin could also throw the error/not be in the room

The admin could also throw the error/not be in the room
HueHe referenced this issue from a commit 2023-11-29 15:45:12 +01:00
HueHe referenced this issue from a commit 2023-11-29 15:53:46 +01:00
HueHe referenced this issue from a commit 2023-11-29 16:35:21 +01:00
Author
Contributor

The situation that caused the bug is a bit more complicated:

  • The creator created the room and added members
  • The creator left the room
  • A person (aka reactor) who participated in the room left
  • This reactor later rejoined the room, reacting to a message from the meantime

So the script made the creator invite the reactor during the room creation. Both left, which is implemented by the script. Then the message with a reaction from the reactor is parsed, but the script tries to invite them as the creator, causing a 403.

No other member has invitations rights, but I implemented a loop for every member to invite them. Finally, this is not necessary in this situation as the original invitation is still valid, so the reactor can join for themself.

I wonder how it behaves if the reactor has not been invited before and if the room is closed, but for now I will just warn about the failed invitation and continue to join.

The situation that caused the bug is a bit more complicated: - The creator created the room and added members - The creator left the room - A person (aka reactor) who participated in the room left - This reactor later rejoined the room, reacting to a message from the meantime So the script made the creator invite the reactor during the room creation. Both left, which is implemented by the script. Then the message with a reaction from the reactor is parsed, but the script tries to invite them as the creator, causing a 403. No other member has invitations rights, but I implemented a loop for every member to invite them. Finally, this is not necessary in this situation as the original invitation is still valid, so the reactor can join for themself. I wonder how it behaves if the reactor has not been invited before and if the room is closed, but for now I will just warn about the failed invitation and continue to join.
HueHe closed this issue 2023-12-01 11:16:24 +01:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
NB-Public/rocketchat2matrix#69
No description provided.