diff --git a/app/durableObjects/ChatRoom.server.ts b/app/durableObjects/ChatRoom.server.ts index 9fa42472..521f9d3e 100644 --- a/app/durableObjects/ChatRoom.server.ts +++ b/app/durableObjects/ChatRoom.server.ts @@ -194,6 +194,23 @@ export class ChatRoom extends Server { } } + async onClose( + connection: Connection, + code: number, + reason: string, + wasClean: boolean + ) { + const meetingId = await this.getMeetingId() + log({ + eventName: 'onClose', + meetingId, + connectionId: connection.id, + code, + reason, + wasClean, + }) + } + async onMessage( connection: Connection, message: WSMessage diff --git a/app/utils/logging.ts b/app/utils/logging.ts index cbddf06a..a4ae461d 100644 --- a/app/utils/logging.ts +++ b/app/utils/logging.ts @@ -13,6 +13,14 @@ export type LogEvent = foundInStorage: boolean connectionId: string } + | { + eventName: 'onClose' + meetingId?: string + connectionId: string + code: number + reason: string + wasClean: boolean + } | { eventName: 'userLeft' meetingId?: string