@syncular/client 0.30.4 → 0.30.5

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.
package/dist/multi-tab.js CHANGED
@@ -187,7 +187,10 @@ export class LeaderBridge {
187
187
  });
188
188
  return;
189
189
  }
190
+ // A call can outlive close(); a closed BroadcastChannel throws on post.
190
191
  this.#invoke(method, args).then((value) => {
192
+ if (this.#closed)
193
+ return;
191
194
  this.#channel.postMessage({
192
195
  t: 'res',
193
196
  epoch: this.#epoch,
@@ -196,6 +199,8 @@ export class LeaderBridge {
196
199
  value,
197
200
  });
198
201
  }, (error) => {
202
+ if (this.#closed)
203
+ return;
199
204
  const shape = error instanceof ClientSyncError
200
205
  ? {
201
206
  code: error.code,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@syncular/client",
3
- "version": "0.30.4",
3
+ "version": "0.30.5",
4
4
  "description": "Syncular TypeScript client core — offline-first sync over SQLite (WASM/OPFS, Bun, Node)",
5
5
  "license": "Apache-2.0",
6
6
  "author": "Benjamin Kniffler",
@@ -89,10 +89,10 @@
89
89
  },
90
90
  "dependencies": {
91
91
  "@sqlite.org/sqlite-wasm": "^3.53.0-build1",
92
- "@syncular/core": "0.30.4"
92
+ "@syncular/core": "0.30.5"
93
93
  },
94
94
  "devDependencies": {
95
- "@syncular/server": "0.30.4",
95
+ "@syncular/server": "0.30.5",
96
96
  "playwright": "1.63.0"
97
97
  }
98
98
  }
package/src/multi-tab.ts CHANGED
@@ -316,8 +316,10 @@ export class LeaderBridge {
316
316
  });
317
317
  return;
318
318
  }
319
+ // A call can outlive close(); a closed BroadcastChannel throws on post.
319
320
  this.#invoke(method, args).then(
320
321
  (value) => {
322
+ if (this.#closed) return;
321
323
  this.#channel.postMessage({
322
324
  t: 'res',
323
325
  epoch: this.#epoch,
@@ -327,6 +329,7 @@ export class LeaderBridge {
327
329
  });
328
330
  },
329
331
  (error: unknown) => {
332
+ if (this.#closed) return;
330
333
  const shape =
331
334
  error instanceof ClientSyncError
332
335
  ? {