From ced3b0228ddbc49e7959d1133042efaa30914c34 Mon Sep 17 00:00:00 2001 From: Jeff Emmett <46964190+Jeff-Emmett@users.noreply.github.com> Date: Fri, 18 Oct 2024 23:37:27 -0400 Subject: [PATCH] remove old chatboxes --- worker/TldrawDurableObject.ts | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/worker/TldrawDurableObject.ts b/worker/TldrawDurableObject.ts index a9e0fb9..e76933c 100644 --- a/worker/TldrawDurableObject.ts +++ b/worker/TldrawDurableObject.ts @@ -96,18 +96,14 @@ export class TldrawDurableObject { this.roomPromise = (async () => { // fetch the room from R2 const roomFromBucket = await this.r2.get(`rooms/${roomId}`) - console.log("we are in a room") // if it doesn't exist, we'll just create a new empty room const initialSnapshot = roomFromBucket ? ((await roomFromBucket.json()) as RoomSnapshot) : undefined if (initialSnapshot) { - initialSnapshot?.documents.slice(0, 1000).forEach(record => { + initialSnapshot.documents = initialSnapshot.documents.filter(record => { const shape = record.state as TLShape - if (shape.type === "chatBox") { - console.log("FOUND CHATBOX") - console.log("record", record) - } + return shape.type !== "chatBox" }) } // create a new TLSocketRoom. This handles all the sync protocol & websocket connections.