@syncular/client 0.73.0 → 0.75.0

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.
@@ -1055,6 +1055,10 @@ export class ReactiveClientStore {
1055
1055
  waiter.resolve();
1056
1056
  }
1057
1057
  catch (error) {
1058
+ // §5.11: the gate refused the edit before it changed anything. The
1059
+ // claim waits; activation applies it again.
1060
+ if (refusedByPreflight(error))
1061
+ return;
1058
1062
  // A failed window edit may already have committed its first eviction chunk.
1059
1063
  // Reconcile through the core before acknowledging any later claim.
1060
1064
  group.appliedKey = '';
@@ -1092,12 +1096,16 @@ export class ReactiveClientStore {
1092
1096
  this.#queries.onChange(batch);
1093
1097
  this.#windows.onChange(batch);
1094
1098
  if (batch.status !== undefined) {
1099
+ const held = this.status.getSnapshot().status?.securityLifecycle === 'preflight';
1095
1100
  this.status.set({
1096
1101
  status: batch.status,
1097
1102
  leadership: this.client.leadershipSnapshot?.(),
1098
1103
  error: undefined,
1099
1104
  isLoading: false,
1100
1105
  });
1106
+ // Window edits held through the preflight apply on activation.
1107
+ if (held && batch.status.securityLifecycle === 'active')
1108
+ this.#reclaimWindows();
1101
1109
  }
1102
1110
  if (batch.conflictsChanged || batch.rejectionsChanged) {
1103
1111
  this.conflicts.refresh();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@syncular/client",
3
- "version": "0.73.0",
3
+ "version": "0.75.0",
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",
@@ -121,11 +121,11 @@
121
121
  },
122
122
  "dependencies": {
123
123
  "@sqlite.org/sqlite-wasm": "^3.53.0-build1",
124
- "@syncular/core": "0.73.0"
124
+ "@syncular/core": "0.75.0"
125
125
  },
126
126
  "devDependencies": {
127
127
  "@electric-sql/pglite": "^0.5.4",
128
- "@syncular/server": "0.73.0",
128
+ "@syncular/server": "0.75.0",
129
129
  "playwright": "1.63.0",
130
130
  "vite": "8.3.4"
131
131
  }
@@ -1251,6 +1251,9 @@ export class ReactiveClientStore {
1251
1251
  }
1252
1252
  for (const waiter of group.waiters.splice(0)) waiter.resolve();
1253
1253
  } catch (error) {
1254
+ // §5.11: the gate refused the edit before it changed anything. The
1255
+ // claim waits; activation applies it again.
1256
+ if (refusedByPreflight(error)) return;
1254
1257
  // A failed window edit may already have committed its first eviction chunk.
1255
1258
  // Reconcile through the core before acknowledging any later claim.
1256
1259
  group.appliedKey = '';
@@ -1289,12 +1292,17 @@ export class ReactiveClientStore {
1289
1292
  this.#queries.onChange(batch);
1290
1293
  this.#windows.onChange(batch);
1291
1294
  if (batch.status !== undefined) {
1295
+ const held =
1296
+ this.status.getSnapshot().status?.securityLifecycle === 'preflight';
1292
1297
  (this.status as ValueEntry<StatusStoreSnapshot>).set({
1293
1298
  status: batch.status,
1294
1299
  leadership: this.client.leadershipSnapshot?.(),
1295
1300
  error: undefined,
1296
1301
  isLoading: false,
1297
1302
  });
1303
+ // Window edits held through the preflight apply on activation.
1304
+ if (held && batch.status.securityLifecycle === 'active')
1305
+ this.#reclaimWindows();
1298
1306
  }
1299
1307
  if (batch.conflictsChanged || batch.rejectionsChanged) {
1300
1308
  this.conflicts.refresh();