feat(92): watcher leaving a room, no room deletion#186
feat(92): watcher leaving a room, no room deletion#186
Conversation
| ) => { | ||
| if (!room.watchers[watcherConnectionString]) { | ||
| console.log( | ||
| '[WS-S] A media event was received for someone ho has not joined the room. Dropping', |
There was a problem hiding this comment.
| '[WS-S] A media event was received for someone ho has not joined the room. Dropping', | |
| '[WS-S] A media event was received from someone who has not joined the room. Dropping', |
| ensureRoomJoined(room, watcherConnectionString); | ||
| delete room.watchers[watcherConnectionString]; | ||
|
|
||
| // TODO delete the room if there is no watcher | ||
| return updateRoom(room, tableName, dynamoDb); |
There was a problem hiding this comment.
Non pour le coup pas possible d'utiliser updateRoom pour retirer un watcher. Il nous faut obligatoirement une commande AWS DynamoDB qui supprime la clé + le sous-doc uniquement, et pas une fonction qui mette à jour toute la liste des watchers (ce qui est le cas d'updateRoom ajd je crois).
EDIT : non en réalité justement pour cette raison, la méthode updateRoom ne met pas à jour la liste des watchers, donc ce code ne marchera tt simplement pas
SInon, ça va péter car on aura des pb de race condition avec les autres watchers.
|
Kudos, SonarCloud Quality Gate passed!
|
findAndEnsureRoomJoinedtoroom-operationsTODO: