cojson 0.19.14 → 0.19.15

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 (41) hide show
  1. package/.turbo/turbo-build.log +1 -1
  2. package/CHANGELOG.md +9 -0
  3. package/dist/PeerState.d.ts +1 -1
  4. package/dist/PeerState.d.ts.map +1 -1
  5. package/dist/PeerState.js.map +1 -1
  6. package/dist/coValueCore/coValueCore.d.ts +7 -1
  7. package/dist/coValueCore/coValueCore.d.ts.map +1 -1
  8. package/dist/coValueCore/coValueCore.js +6 -0
  9. package/dist/coValueCore/coValueCore.js.map +1 -1
  10. package/dist/coValues/group.d.ts.map +1 -1
  11. package/dist/coValues/group.js +16 -4
  12. package/dist/coValues/group.js.map +1 -1
  13. package/dist/localNode.d.ts +0 -1
  14. package/dist/localNode.d.ts.map +1 -1
  15. package/dist/localNode.js +4 -4
  16. package/dist/localNode.js.map +1 -1
  17. package/dist/queue/LocalTransactionsSyncQueue.d.ts +0 -1
  18. package/dist/queue/LocalTransactionsSyncQueue.d.ts.map +1 -1
  19. package/dist/queue/LocalTransactionsSyncQueue.js +0 -2
  20. package/dist/queue/LocalTransactionsSyncQueue.js.map +1 -1
  21. package/dist/storage/sqlite/client.d.ts.map +1 -1
  22. package/dist/storage/sqlite/client.js.map +1 -1
  23. package/dist/storage/sqliteAsync/client.d.ts.map +1 -1
  24. package/dist/storage/sqliteAsync/client.js.map +1 -1
  25. package/dist/storage/storageAsync.d.ts +1 -1
  26. package/dist/storage/storageAsync.js +8 -8
  27. package/dist/storage/storageSync.d.ts +1 -1
  28. package/dist/storage/storageSync.js +8 -8
  29. package/dist/sync.js +1 -1
  30. package/dist/sync.js.map +1 -1
  31. package/package.json +4 -4
  32. package/src/PeerState.ts +1 -1
  33. package/src/coValueCore/coValueCore.ts +7 -1
  34. package/src/coValues/group.ts +16 -4
  35. package/src/localNode.ts +4 -5
  36. package/src/queue/LocalTransactionsSyncQueue.ts +0 -2
  37. package/src/storage/sqlite/client.ts +0 -1
  38. package/src/storage/sqliteAsync/client.ts +0 -1
  39. package/src/storage/storageAsync.ts +8 -8
  40. package/src/storage/storageSync.ts +8 -8
  41. package/src/sync.ts +1 -1
@@ -40,10 +40,10 @@ export class StorageApiAsync implements StorageAPI {
40
40
  this.dbClient = dbClient;
41
41
  }
42
42
 
43
- knwonStates = new StorageKnownState();
43
+ knownStates = new StorageKnownState();
44
44
 
45
45
  getKnownState(id: string): CoValueKnownState {
46
- return this.knwonStates.getKnownState(id);
46
+ return this.knownStates.getKnownState(id);
47
47
  }
48
48
 
49
49
  async load(
@@ -91,7 +91,7 @@ export class StorageApiAsync implements StorageAPI {
91
91
  }),
92
92
  );
93
93
 
94
- const knownState = this.knwonStates.getKnownState(coValueRow.id);
94
+ const knownState = this.knownStates.getKnownState(coValueRow.id);
95
95
  knownState.header = true;
96
96
 
97
97
  for (const sessionRow of allCoValueSessions) {
@@ -169,7 +169,7 @@ export class StorageApiAsync implements StorageAPI {
169
169
  );
170
170
  }
171
171
 
172
- this.knwonStates.handleUpdate(coValueRow.id, knownState);
172
+ this.knownStates.handleUpdate(coValueRow.id, knownState);
173
173
  done?.(true);
174
174
  }
175
175
 
@@ -270,12 +270,12 @@ export class StorageApiAsync implements StorageAPI {
270
270
 
271
271
  if (!storedCoValueRowID) {
272
272
  const knownState = emptyKnownState(id as RawCoID);
273
- this.knwonStates.setKnownState(id, knownState);
273
+ this.knownStates.setKnownState(id, knownState);
274
274
 
275
275
  return this.handleCorrection(knownState, correctionCallback);
276
276
  }
277
277
 
278
- const knownState = this.knwonStates.getKnownState(id);
278
+ const knownState = this.knownStates.getKnownState(id);
279
279
  knownState.header = true;
280
280
 
281
281
  let invalidAssumptions = false;
@@ -313,7 +313,7 @@ export class StorageApiAsync implements StorageAPI {
313
313
  });
314
314
  }
315
315
 
316
- this.knwonStates.handleUpdate(id, knownState);
316
+ this.knownStates.handleUpdate(id, knownState);
317
317
 
318
318
  if (invalidAssumptions) {
319
319
  return this.handleCorrection(knownState, correctionCallback);
@@ -389,7 +389,7 @@ export class StorageApiAsync implements StorageAPI {
389
389
  }
390
390
 
391
391
  waitForSync(id: string, coValue: CoValueCore) {
392
- return this.knwonStates.waitForSync(id, coValue);
392
+ return this.knownStates.waitForSync(id, coValue);
393
393
  }
394
394
 
395
395
  close() {
@@ -48,10 +48,10 @@ export class StorageApiSync implements StorageAPI {
48
48
  this.streamingCounter.add(0);
49
49
  }
50
50
 
51
- knwonStates = new StorageKnownState();
51
+ knownStates = new StorageKnownState();
52
52
 
53
53
  getKnownState(id: string): CoValueKnownState {
54
- return this.knwonStates.getKnownState(id);
54
+ return this.knownStates.getKnownState(id);
55
55
  }
56
56
 
57
57
  async load(
@@ -93,7 +93,7 @@ export class StorageApiSync implements StorageAPI {
93
93
  }
94
94
  }
95
95
 
96
- const knownState = this.knwonStates.getKnownState(coValueRow.id);
96
+ const knownState = this.knownStates.getKnownState(coValueRow.id);
97
97
  knownState.header = true;
98
98
 
99
99
  for (const sessionRow of allCoValueSessions) {
@@ -174,7 +174,7 @@ export class StorageApiSync implements StorageAPI {
174
174
  this.streamingCounter.add(-1);
175
175
  }
176
176
 
177
- this.knwonStates.handleUpdate(coValueRow.id, knownState);
177
+ this.knownStates.handleUpdate(coValueRow.id, knownState);
178
178
  done?.(true);
179
179
  }
180
180
 
@@ -247,12 +247,12 @@ export class StorageApiSync implements StorageAPI {
247
247
 
248
248
  if (!storedCoValueRowID) {
249
249
  const knownState = emptyKnownState(id as RawCoID);
250
- this.knwonStates.setKnownState(id, knownState);
250
+ this.knownStates.setKnownState(id, knownState);
251
251
 
252
252
  return this.handleCorrection(knownState, correctionCallback);
253
253
  }
254
254
 
255
- const knownState = this.knwonStates.getKnownState(id);
255
+ const knownState = this.knownStates.getKnownState(id);
256
256
  knownState.header = true;
257
257
 
258
258
  let invalidAssumptions = false;
@@ -287,7 +287,7 @@ export class StorageApiSync implements StorageAPI {
287
287
  });
288
288
  }
289
289
 
290
- this.knwonStates.handleUpdate(id, knownState);
290
+ this.knownStates.handleUpdate(id, knownState);
291
291
 
292
292
  if (invalidAssumptions) {
293
293
  return this.handleCorrection(knownState, correctionCallback);
@@ -362,7 +362,7 @@ export class StorageApiSync implements StorageAPI {
362
362
  }
363
363
 
364
364
  waitForSync(id: string, coValue: CoValueCore) {
365
- return this.knwonStates.waitForSync(id, coValue);
365
+ return this.knownStates.waitForSync(id, coValue);
366
366
  }
367
367
 
368
368
  close() {
package/src/sync.ts CHANGED
@@ -358,7 +358,7 @@ export class SyncManager {
358
358
  });
359
359
 
360
360
  if (!skipReconciliation && peerState.role === "server") {
361
- void this.startPeerReconciliation(peerState);
361
+ this.startPeerReconciliation(peerState);
362
362
  }
363
363
 
364
364
  peerState.incoming.onMessage((msg) => {