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

Method getCurrentBranch

src/durable-objects/user-notes.ts:251–260  ·  view source on GitHub ↗
(noteId: string)

Source from the content-addressed store, hash-verified

249 );
250 } else {
251 // Empty doc (or guarding existing content from an empty regression):
252 // only refresh yjs_state on a row that already exists. Never create an
253 // empty "Untitled" row — that's the "don't persist blank notes" rule.
254 this.sql.exec(
255 "UPDATE notes SET yjs_state = ?, yjs_initialized_at = COALESCE(yjs_initialized_at, unixepoch()), updated_at = unixepoch() WHERE id = ?",
256 state, noteId
257 );
258 }
259 }
260
261 private scheduleDocPersist(noteId: string, doc: Y.Doc, delayMs: number, attempt = 0) {
262 const existing = this.saveTimers.get(noteId);
263 if (existing) clearTimeout(existing);

Callers 3

createVersionMethod · 0.95
beginEditSessionMethod · 0.95
fetchMethod · 0.95

Calls 2

getNoteMethod · 0.95
ensureDefaultBranchMethod · 0.95

Tested by

no test coverage detected