diff --git a/light9/web/RdfDbChannel.ts b/light9/web/RdfDbChannel.ts --- a/light9/web/RdfDbChannel.ts +++ b/light9/web/RdfDbChannel.ts @@ -57,9 +57,9 @@ export class RdfDbChannel { return true; } - disconnect() { + disconnect(why:string) { // will be followed by an autoconnect - log("disconnect requested"); + log("disconnect requested:", why); if (this.ws !== undefined) { const closeHandler = this.ws.onclose?.bind(this.ws); if (!closeHandler) { @@ -123,7 +123,7 @@ export class RdfDbChannel { private onWsError(e: Event) { log("ws error", e); - this.disconnect(); + this.disconnect("ws error"); this.updateStatus(); } diff --git a/light9/web/SyncedGraph.ts b/light9/web/SyncedGraph.ts --- a/light9/web/SyncedGraph.ts +++ b/light9/web/SyncedGraph.ts @@ -38,7 +38,7 @@ export class SyncedGraph { this.autoDeps = new AutoDependencies(this); this.autoDeps.graphError.subscribe((e) => { log("graph learned of error - reconnecting", e); - this.client.disconnect(); + this.client.disconnect("graph error"); }); this.clearGraph(); diff --git a/light9/web/patch.ts b/light9/web/patch.ts --- a/light9/web/patch.ts +++ b/light9/web/patch.ts @@ -77,6 +77,9 @@ export class Patch { } dump(): string { + if (this.dels.size + this.adds.size > 20) { + return this.summary(); + } const lines: string[] = []; const s = (term: N3.Term): string => { if (term.termType == "Literal") return term.value; diff --git a/light9/web/rdfdbclient.ts b/light9/web/rdfdbclient.ts --- a/light9/web/rdfdbclient.ts +++ b/light9/web/rdfdbclient.ts @@ -44,8 +44,8 @@ export class RdfDbClient { this._continueSending(); } - disconnect() { - this.channel.disconnect(); + disconnect(why:string) { + this.channel.disconnect(why); } async _continueSending() {