castle-web-sdk 0.4.41 → 0.4.42

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/runtime.js +7 -0
  2. package/package.json +1 -1
package/dist/runtime.js CHANGED
@@ -8,6 +8,8 @@ const HOST_CAPTURE_REQUEST = "castle-capture-cover";
8
8
  const HOST_CAPTURE_RESULT = "castle-capture-cover-result";
9
9
  let ws = null;
10
10
  let logBuffer = [];
11
+ // The shell's play log keeps the same number of lines.
12
+ const MAX_BUFFERED_MESSAGES = 500;
11
13
  let nextRequestId = 1;
12
14
  const pendingRequests = new Map();
13
15
  // Local-dev command channel: the `castle-web serve` dev server is the host, so
@@ -306,6 +308,11 @@ function sendMsg(msg) {
306
308
  }
307
309
  else {
308
310
  logBuffer.push(msg);
311
+ // A deck logging every frame fills this while no socket is open, so the
312
+ // oldest messages are dropped.
313
+ if (logBuffer.length > MAX_BUFFERED_MESSAGES) {
314
+ logBuffer.splice(0, logBuffer.length - MAX_BUFFERED_MESSAGES);
315
+ }
309
316
  }
310
317
  }
311
318
  function sendLocalRequest(msg) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "castle-web-sdk",
3
- "version": "0.4.41",
3
+ "version": "0.4.42",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/castle-xyz/castle-experimental-web.git"