MCPcopy Create free account
hub / github.com/Dhravya/notty / webSocketClose

Method webSocketClose

src/durable-objects/user-notes.ts:974–980  ·  view source on GitHub ↗
(ws: WebSocket)

Source from the content-addressed store, hash-verified

972
973 // Apply the restored content
974 const restoredTitle = (this.sql.exec(
975 "SELECT title FROM note_versions WHERE id = ?", version_id
976 ).toArray()[0] as any)?.title || "Untitled";
977
978 this.sql.exec(
979 "UPDATE notes SET title = ?, content = ?, yjs_state = NULL, updated_at = unixepoch() WHERE id = ?",
980 restoredTitle, restoredContent, noteId
981 );
982
983 await this.createVersion(noteId, restoredTitle, restoredContent, "restore", "restore", "Restored version");

Callers

nothing calls this directly

Calls 1

flushPendingSaveMethod · 0.95

Tested by

no test coverage detected