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:
parent
19885c98e6
commit
d8e954dfb6
|
|
@ -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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue