comparison web/RdfDbChannel.ts @ 2421:ac55319a2eac

don't drop patches that arrive before we get WS connected
author drewp@bigasterisk.com
date Tue, 21 May 2024 16:10:39 -0700
parents 4556eebe5d73
children
comparison
equal deleted inserted replaced
2420:d5750b2aaa9e 2421:ac55319a2eac
46 this.openConnection(); 46 this.openConnection();
47 } 47 }
48 sendMessage(body: string): boolean { 48 sendMessage(body: string): boolean {
49 // one try, best effort, true if we think it worked 49 // one try, best effort, true if we think it worked
50 if (!this.ws || this.ws.readyState !== this.ws.OPEN) { 50 if (!this.ws || this.ws.readyState !== this.ws.OPEN) {
51 log("dropping message: " + body);
51 return false; 52 return false;
52 } 53 }
53 log("send patch to server, " + body.length + " bytes"); 54 log("send patch to server, " + body.length + " bytes");
54 this.ws.send(body); 55 this.ws.send(body);
55 this.messagesSent++; 56 this.messagesSent++;