Skip to content

Commit

Permalink
Merge pull request #90 from cloudflare/restore-on-error-handler
Browse files Browse the repository at this point in the history
Restore onError handler in server
  • Loading branch information
third774 authored Aug 19, 2024
2 parents 49cb2cc + 70f9378 commit 583792c
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 583792c

Please sign in to comment.