AntoineA67 / ft_transcendence

4 stars 1 forks source link

Crashes by scros #218

Closed alpyt42 closed 9 months ago

alpyt42 commented 9 months ago
[Nest] 458  - 11/28/2023, 2:23:19 PM   ERROR [WsExceptionsHandler] Cannot read properties of null (reading 'ban')
TypeError: Cannot read properties of null (reading 'ban')
    at RoomGateway.handleSendMessage (/app/dist/room/room.gateway.js:201:20)
    at async RoomGateway.<anonymous> (/app/node_modules/@nestjs/websockets/context/ws-proxy.js:12:32)
    at async WebSocketsController.pickResult (/app/node_modules/@nestjs/websockets/web-sockets-controller.js:96:24)
[Nest] 458  - 11/28/2023, 2:23:23 PM   ERROR [WsExceptionsHandler] Cannot read properties of null (reading 'ban')
TypeError: Cannot read properties of null (reading 'ban')
    at RoomGateway.handleSendMessage (/app/dist/room/room.gateway.js:201:20)
    at async RoomGateway.<anonymous> (/app/node_modules/@nestjs/websockets/context/ws-proxy.js:12:32)
    at async WebSocketsController.pickResult (/app/node_modules/@nestjs/websockets/web-sockets-controller.js:96:24)
[Nest] 458  - 11/28/2023, 2:23:23 PM   ERROR [WsExceptionsHandler] Cannot read properties of null (reading 'ban')
TypeError: Cannot read properties of null (reading 'ban')
    at RoomGateway.handleSendMessage (/app/dist/room/room.gateway.js:201:20)
    at async RoomGateway.<anonymous> (/app/node_modules/@nestjs/websockets/context/ws-proxy.js:12:32)
    at async WebSocketsController.pickResult (/app/node_modules/@nestjs/websockets/web-sockets-controller.js:96:24)
[Nest] 458  - 11/28/2023, 2:23:24 PM   ERROR [WsExceptionsHandler] Cannot read properties of null (reading 'ban')
TypeError: Cannot read properties of null (reading 'ban')
    at RoomGateway.handleSendMessage (/app/dist/room/room.gateway.js:201:20)
    at async RoomGateway.<anonymous> (/app/node_modules/@nestjs/websockets/context/ws-proxy.js:12:32)
    at async WebSocketsController.pickResult (/app/node_modules/@nestjs/websockets/web-sockets-controller.js:96:24)
[Nest] 458  - 11/28/2023, 2:23:24 PM   ERROR [WsExceptionsHandler] Cannot read properties of null (reading 'ban')
TypeError: Cannot read properties of null (reading 'ban')
    at RoomGateway.handleSendMessage (/app/dist/room/room.gateway.js:201:20)
    at async RoomGateway.<anonymous> (/app/node_modules/@nestjs/websockets/context/ws-proxy.js:12:32)
    at async WebSocketsController.pickResult (/app/node_modules/@nestjs/websockets/web-sockets-controller.js:96:24)
[Nest] 458  - 11/28/2023, 2:24:02 PM   ERROR [WsExceptionsHandler] Cannot read properties of null (reading 'ban')
TypeError: Cannot read properties of null (reading 'ban')
    at RoomGateway.handleSendMessage (/app/dist/room/room.gateway.js:201:20)
    at async RoomGateway.<anonymous> (/app/node_modules/@nestjs/websockets/context/ws-proxy.js:12:32)
    at async WebSocketsController.pickResult (/app/node_modules/@nestjs/websockets/web-sockets-controller.js:96:24)
[Nest] 458  - 11/28/2023, 2:24:03 PM   ERROR [WsExceptionsHandler] Cannot read properties of null (reading 'ban')
TypeError: Cannot read properties of null (reading 'ban')
    at RoomGateway.handleSendMessage (/app/dist/room/room.gateway.js:201:20)
    at async RoomGateway.<anonymous> (/app/node_modules/@nestjs/websockets/context/ws-proxy.js:12:32)
    at async WebSocketsController.pickResult (/app/node_modules/@nestjs/websockets/web-sockets-controller.js:96:24)
[Nest] 458  - 11/28/2023, 2:24:03 PM   ERROR [WsExceptionsHandler] Cannot read properties of null (reading 'ban')
TypeError: Cannot read properties of null (reading 'ban')
    at RoomGateway.handleSendMessage (/app/dist/room/room.gateway.js:201:20)
    at async RoomGateway.<anonymous> (/app/node_modules/@nestjs/websockets/context/ws-proxy.js:12:32)
    at async WebSocketsController.pickResult (/app/node_modules/@nestjs/websockets/web-sockets-controller.js:96:24)
[Nest] 458  - 11/28/2023, 2:24:04 PM   ERROR [WsExceptionsHandler] Cannot read properties of null (reading 'ban')
TypeError: Cannot read properties of null (reading 'ban')
    at RoomGateway.handleSendMessage (/app/dist/room/room.gateway.js:201:20)
    at async RoomGateway.<anonymous> (/app/node_modules/@nestjs/websockets/context/ws-proxy.js:12:32)
    at async WebSocketsController.pickResult (/app/node_modules/@nestjs/websockets/web-sockets-controller.js:96:24)
[Nest] 458  - 11/28/2023, 2:24:04 PM   ERROR [WsExceptionsHandler] Cannot read properties of null (reading 'ban')
TypeError: Cannot read properties of null (reading 'ban')
    at RoomGateway.handleSendMessage (/app/dist/room/room.gateway.js:201:20)
    at async RoomGateway.<anonymous> (/app/node_modules/@nestjs/websockets/context/ws-proxy.js:12:32)
    at async WebSocketsController.pickResult (/app/node_modules/@nestjs/websockets/web-sockets-controller.js:96:24)
ls

warn(prisma-client) This is the 10th instance of Prisma Client being started. Make sure this is intentional.
[Nest] 458  - 11/28/2023, 2:46:28 PM   ERROR [WsExceptionsHandler] Cannot read properties of undefined (reading 'trim')
TypeError: Cannot read properties of undefined (reading 'trim')
    at RoomGateway.handleBanMember (/app/dist/room/room.gateway.js:311:68)
    at /app/node_modules/@nestjs/websockets/context/ws-context-creator.js:43:33
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async RoomGateway.<anonymous> (/app/node_modules/@nestjs/websockets/context/ws-proxy.js:12:32)
    at async WebSocketsController.pickResult (/app/node_modules/@nestjs/websockets/web-sockets-controller.js:96:24)
[Nest] 458  - 11/28/2023, 2:46:51 PM   ERROR [WsExceptionsHandler] content.roomId.trim is not a function
TypeError: content.roomId.trim is not a function
    at RoomGateway.handleBanMember (/app/dist/room/room.gateway.js:311:68)
    at /app/node_modules/@nestjs/websockets/context/ws-context-creator.js:43:33
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async RoomGateway.<anonymous> (/app/node_modules/@nestjs/websockets/context/ws-proxy.js:12:32)
    at async WebSocketsController.pickResult (/app/node_modules/@nestjs/websockets/web-sockets-controller.js:96:24)
[Nest] 458  - 11/28/2023, 2:46:57 PM   ERROR [WsExceptionsHandler] content.roomId.trim is not a function
TypeError: content.roomId.trim is not a function
    at RoomGateway.handleBanMember (/app/dist/room/room.gateway.js:311:68)
    at /app/node_modules/@nestjs/websockets/context/ws-context-creator.js:43:33
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async RoomGateway.<anonymous> (/app/node_modules/@nestjs/websockets/context/ws-proxy.js:12:32)
    at async WebSocketsController.pickResult (/app/node_modules/@nestjs/websockets/web-sockets-controller.js:96:24)
[Nest] 458  - 11/28/2023, 2:47:20 PM   ERROR [WsExceptionsHandler] Cannot read properties of undefined (reading 'toString')
TypeError: Cannot read properties of undefined (reading 'toString')
    at RoomGateway.handleBanMember (/app/dist/room/room.gateway.js:311:31)
    at /app/node_modules/@nestjs/websockets/context/ws-context-creator.js:43:33
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async RoomGateway.<anonymous> (/app/node_modules/@nestjs/websockets/context/ws-proxy.js:12:32)
    at async WebSocketsController.pickResult (/app/node_modules/@nestjs/websockets/web-sockets-controller.js:96:24)
alpyt42 commented 9 months ago

On peut ajouter un ami sans lui demander son avis (LOL) @Sasha-Liu

alpyt42 commented 9 months ago

Tester socket dans le navigateur console :

var socket;
var oldSend = WebSocket.prototype.send;
WebSocket.prototype.send = function (data)
{
    socket = this;
    oldSend.call(this, data);
}

Faire une action qui recupere la socket Utilser l'onglet network/message pour recuperer le message exemple :

socket.send('42/chats,3["banMember",{"memberId":2,"roomId":"3","action":false}]'); 

GOOGLE :


var socket;
var oldSend = WebSocket.prototype.send;
WebSocket.prototype.send = function (data)
{
    socket = this;
    oldSend.call(this, data);
}
ƒ (data)
{
    socket = this;
    oldSend.call(this, data);
}
socket.send('42/game,["matchAgainst",{"id":1}]');```
alpyt42 commented 9 months ago

Game : ne pas pouvoir selectionner une couleur > 255 ou qui n'existe pas image

ca crash aussi si on envoi NaN

Sasha-Liu commented 9 months ago

ui demander son avis (LOL)

Avec socket ? Comment reproduire ?

alpyt42 commented 9 months ago

@Sasha-Liu il a envoyé depuis un user un socket.send() qui fait valider la relation

Sasha-Liu commented 9 months ago

@Sasha-Liu il a envoyé depuis un user un socket.send() qui fait valider la relation

ok je vois XD