Skip to content

Commit

Permalink
Merge pull request #80 from cloudflare/onerror-no-broadcast
Browse files Browse the repository at this point in the history
don't broadcast change onError just like onChange
  • Loading branch information
third774 authored Aug 13, 2024
2 parents 23fb804 + e053814 commit c23eee0
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion app/durableObjects/ChatRoom.server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,11 @@ export class ChatRoom extends Server<Env> {
}

onError(): void | Promise<void> {
this.broadcastState()
// 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()
}

alarm(): void | Promise<void> {
Expand Down

0 comments on commit c23eee0

Please sign in to comment.