# HG changeset patch # User drewp@bigasterisk.com # Date 1685433560 25200 # Node ID c070f46c07614a2e76b299108e21b645756f9d1f # Parent 0a11698fecc4627b29c7eb578a3809d00fbb7bd6 you can ask to apply empty patch and it will no-op diff -r 0a11698fecc4 -r c070f46c0761 light9/web/SyncedGraph.ts --- a/light9/web/SyncedGraph.ts Mon May 29 23:37:08 2023 -0700 +++ b/light9/web/SyncedGraph.ts Tue May 30 00:59:20 2023 -0700 @@ -156,12 +156,12 @@ 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"); }