changeset 2289:f2c6b39c155c

fix messagesSend counter
author drewp@bigasterisk.com
date Mon, 29 May 2023 22:49:40 -0700
parents ce1c73235ee2
children e9239995eb57
files light9/web/RdfDbChannel.ts light9/web/rdfdbclient.ts
diffstat 2 files changed, 4 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/light9/web/RdfDbChannel.ts	Mon May 29 22:32:50 2023 -0700
+++ b/light9/web/RdfDbChannel.ts	Mon May 29 22:49:40 2023 -0700
@@ -52,6 +52,8 @@
     }
     log("send patch to server, " + body.length + " bytes");
     this.ws.send(body);
+    this.messagesSent++;
+    this.updateStatus();
     return true;
   }
 
--- a/light9/web/rdfdbclient.ts	Mon May 29 22:32:50 2023 -0700
+++ b/light9/web/rdfdbclient.ts	Mon May 29 22:49:40 2023 -0700
@@ -1,7 +1,7 @@
 import debug from "debug";
 import { parseJsonPatch, Patch } from "./patch";
 import { RdfDbChannel } from "./RdfDbChannel";
-export const log = debug("rdfdbclient");
+const log = debug("rdfdbclient");
 
 export class RdfDbClient {
   private channel: RdfDbChannel;
@@ -28,7 +28,6 @@
       this.clearGraphOnNewConnection();
     });
     this.channel.serverMessage.subscribe((m) => {
-      log('got server json', m.body)
       parseJsonPatch(m.body, (p: Patch) => {
         log('patch from server:', p.dump())
         if (p.isEmpty()) {
@@ -51,7 +50,7 @@
 
   async _continueSending() {
     // we could call this less often and coalesce patches together to optimize
-    // the dragging cases.
+    // the dragging cases. See rdfdb 'compactPatches' and 'processInbox'.
     while (this._patchesToSend.length) {
       const patch = this._patchesToSend.splice(0, 1)[0];
       const json = await patch.toJsonPatch();