# HG changeset patch # User drewp@bigasterisk.com # Date 2023-05-30 07:59:20 # Node ID c070f46c07614a2e76b299108e21b645756f9d1f # Parent 0a11698fecc4627b29c7eb578a3809d00fbb7bd6 you can ask to apply empty patch and it will no-op diff --git a/light9/web/SyncedGraph.ts b/light9/web/SyncedGraph.ts --- a/light9/web/SyncedGraph.ts +++ b/light9/web/SyncedGraph.ts @@ -156,12 +156,12 @@ export class SyncedGraph { log("not connected-- dropping patch"); return; } - if (patch.isEmpty()) throw "should not get to this point with empty patch"; - - this._applyPatch(patch); - if (this.client) { - log("sending patch:\n", patch.dump()); - this.client.sendPatch(patch); + if (!patch.isEmpty()) { + this._applyPatch(patch); + if (this.client) { + log("sending patch:\n", patch.dump()); + this.client.sendPatch(patch); + } } console.timeEnd("applyAndSendPatch"); }