# Знайди баг: Node.js / NestJS > Один фрагмент коду. Знайди баг або доведи, що його немає. Щоденне завдання: 2026-08-19 (UTC) · Mid-Level ```typescript import { WebSocketGateway, SubscribeMessage, MessageBody, ConnectedSocket } from '@nestjs/websockets'; import { Socket } from 'socket.io'; import { MessagesService } from './messages.service'; @WebSocketGateway({ namespace: 'chat' }) export class ChatGateway { constructor(private readonly messages: MessagesService) {} @SubscribeMessage('joinRoom') async joinRoom( @ConnectedSocket() client: Socket, @MessageBody() data: { roomId: string }, ) { client.join(data.roomId); const history = await this.messages.getRoomHistory(data.roomId); client.emit('history', history); } } ``` ## Твій вердикт - Вразливість безпеки - Помилка логіки - Стиль коду - Без проблем Одна спроба на день. Відповідь з'явиться одразу після. --- Source: SharpSkill (https://sharpskill.dev), tech interview preparation for your real stack. HTML version of this page: https://sharpskill.dev/uk/shchodenne-zavdannia/node-nestjs