fix: persist docs created via setDoc (fixes payment not found)

SyncServer.setDoc() was not calling onDocChange, so documents created
via setDoc (including payment requests) were only stored in memory and
lost on container restart. This caused "Payment request not found"
errors after deploys. Now setDoc triggers the same persistence callback
as changeDoc.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Jeff Emmett 2026-04-03 02:54:11 +00:00
parent 19885c98e6
commit d8e954dfb6
1 changed files with 3 additions and 0 deletions

View File

@ -247,6 +247,9 @@ export class SyncServer {
setDoc(docId: string, doc: Automerge.Doc<any>): void { setDoc(docId: string, doc: Automerge.Doc<any>): void {
this.#docs.set(docId, doc); this.#docs.set(docId, doc);
this.#syncDocToAllPeers(docId); this.#syncDocToAllPeers(docId);
if (this.#onDocChange) {
this.#onDocChange(docId, doc);
}
} }
/** /**