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.
- package/.turbo/turbo-build.log +1 -1
- package/CHANGELOG.md +9 -0
- package/dist/PeerState.d.ts +1 -1
- package/dist/PeerState.d.ts.map +1 -1
- package/dist/PeerState.js.map +1 -1
- package/dist/coValueCore/coValueCore.d.ts +7 -1
- package/dist/coValueCore/coValueCore.d.ts.map +1 -1
- package/dist/coValueCore/coValueCore.js +6 -0
- package/dist/coValueCore/coValueCore.js.map +1 -1
- package/dist/coValues/group.d.ts.map +1 -1
- package/dist/coValues/group.js +16 -4
- package/dist/coValues/group.js.map +1 -1
- package/dist/localNode.d.ts +0 -1
- package/dist/localNode.d.ts.map +1 -1
- package/dist/localNode.js +4 -4
- package/dist/localNode.js.map +1 -1
- package/dist/queue/LocalTransactionsSyncQueue.d.ts +0 -1
- package/dist/queue/LocalTransactionsSyncQueue.d.ts.map +1 -1
- package/dist/queue/LocalTransactionsSyncQueue.js +0 -2
- package/dist/queue/LocalTransactionsSyncQueue.js.map +1 -1
- package/dist/storage/sqlite/client.d.ts.map +1 -1
- package/dist/storage/sqlite/client.js.map +1 -1
- package/dist/storage/sqliteAsync/client.d.ts.map +1 -1
- package/dist/storage/sqliteAsync/client.js.map +1 -1
- package/dist/storage/storageAsync.d.ts +1 -1
- package/dist/storage/storageAsync.js +8 -8
- package/dist/storage/storageSync.d.ts +1 -1
- package/dist/storage/storageSync.js +8 -8
- package/dist/sync.js +1 -1
- package/dist/sync.js.map +1 -1
- package/package.json +4 -4
- package/src/PeerState.ts +1 -1
- package/src/coValueCore/coValueCore.ts +7 -1
- package/src/coValues/group.ts +16 -4
- package/src/localNode.ts +4 -5
- package/src/queue/LocalTransactionsSyncQueue.ts +0 -2
- package/src/storage/sqlite/client.ts +0 -1
- package/src/storage/sqliteAsync/client.ts +0 -1
- package/src/storage/storageAsync.ts +8 -8
- package/src/storage/storageSync.ts +8 -8
- 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
|
-
|
|
43
|
+
knownStates = new StorageKnownState();
|
|
44
44
|
|
|
45
45
|
getKnownState(id: string): CoValueKnownState {
|
|
46
|
-
return this.
|
|
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.
|
|
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.
|
|
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.
|
|
273
|
+
this.knownStates.setKnownState(id, knownState);
|
|
274
274
|
|
|
275
275
|
return this.handleCorrection(knownState, correctionCallback);
|
|
276
276
|
}
|
|
277
277
|
|
|
278
|
-
const knownState = this.
|
|
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.
|
|
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.
|
|
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
|
-
|
|
51
|
+
knownStates = new StorageKnownState();
|
|
52
52
|
|
|
53
53
|
getKnownState(id: string): CoValueKnownState {
|
|
54
|
-
return this.
|
|
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.
|
|
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.
|
|
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.
|
|
250
|
+
this.knownStates.setKnownState(id, knownState);
|
|
251
251
|
|
|
252
252
|
return this.handleCorrection(knownState, correctionCallback);
|
|
253
253
|
}
|
|
254
254
|
|
|
255
|
-
const knownState = this.
|
|
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.
|
|
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.
|
|
365
|
+
return this.knownStates.waitForSync(id, coValue);
|
|
366
366
|
}
|
|
367
367
|
|
|
368
368
|
close() {
|
package/src/sync.ts
CHANGED