changeset 2284:dcfa69d53fd2

don't apply empty patch
author drewp@bigasterisk.com
date Mon, 29 May 2023 19:37:41 -0700
parents 9bdc25ed5df5
children cc371473ada1
files light9/web/rdfdbclient.ts
diffstat 1 files changed, 8 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/light9/web/rdfdbclient.ts	Mon May 29 19:37:11 2023 -0700
+++ b/light9/web/rdfdbclient.ts	Mon May 29 19:37:41 2023 -0700
@@ -28,7 +28,14 @@
       this.clearGraphOnNewConnection();
     });
     this.channel.serverMessage.subscribe((m) => {
-      parseJsonPatch(m.body, this.applyPatch.bind(this));
+      log('got server json', m.body)
+      parseJsonPatch(m.body, (p: Patch) => {
+        log('patch from server:', p.dump())
+        if (p.isEmpty()) {
+          return;
+        }
+        this.applyPatch(p);
+      });
     });
   }