Skip to content

Commit

Permalink
Restore onError handler in server
Browse files Browse the repository at this point in the history
Now that we've fixed the issue where users connecting should try to look
up an existing session before creating a new one, we should restore this
  • Loading branch information
third774 committed Aug 19, 2024
1 parent 49cb2cc commit 70f9378
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions app/durableObjects/ChatRoom.server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -225,17 +225,13 @@ export class ChatRoom extends Server<Env> {
onClose() {
// while it makes sense to broadcast immediately on close,
// it's possible that the websocket just closed for an instant
// and will reconnect momentarily.
// and will reconnect momentarily.
// so let's just let the alarm handler do the broadcasting.
// this.broadcastState()
// this.broadcastRoomState()
}

onError(): void | Promise<void> {
// while it makes sense to broadcast immediately on close,
// it's possible that the websocket just closed for an instant
// and will reconnect momentarily.
// so let's just let the alarm handler do the broadcasting.
// this.broadcastState()
this.broadcastRoomState()
}

async cleanupOldConnections() {
Expand Down

0 comments on commit 70f9378

Please sign in to comment.