Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Ignore current participant if removed concurrently
When retrieving the conversation list for a user, there is a
time window between retrieving the list and the participant information.
If in that time window, a concurrent request removes the user from the
room, or even the room got deleted, this could cause a
ParticipantNotFoundException.

This fix prevents the latter exception to make the whole call return a
404. Instead, it skips the obsoleted entry and carries on with the list.

Signed-off-by: Vincent Petry <[email protected]>
  • Loading branch information
PVince81 authored and backportbot[bot] committed Jun 14, 2021
commit 72ec40f1e60833b4859217f5b6006f5933df226e
3 changes: 3 additions & 0 deletions lib/Controller/RoomController.php
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,9 @@ public function getRooms(int $noStatusUpdate = 0): DataResponse {
try {
$return[] = $this->formatRoom($room, $room->getParticipant($this->userId));
} catch (RoomNotFoundException $e) {
} catch (ParticipantNotFoundException $e) {
// for example in case the room was deleted concurrently,
// the user is not a participant any more
} catch (\RuntimeException $e) {
}
}
Expand Down