@fluidframework/datastore 2.71.0 → 2.72.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.
- package/CHANGELOG.md +4 -21
- package/api-report/datastore.legacy.beta.api.md +2 -0
- package/dist/dataStoreLayerCompatState.js +1 -1
- package/dist/dataStoreLayerCompatState.js.map +1 -1
- package/dist/dataStoreRuntime.d.ts +2 -0
- package/dist/dataStoreRuntime.d.ts.map +1 -1
- package/dist/dataStoreRuntime.js +62 -44
- package/dist/dataStoreRuntime.js.map +1 -1
- package/dist/packageVersion.d.ts +1 -1
- package/dist/packageVersion.js +1 -1
- package/dist/packageVersion.js.map +1 -1
- package/lib/dataStoreLayerCompatState.js +1 -1
- package/lib/dataStoreLayerCompatState.js.map +1 -1
- package/lib/dataStoreRuntime.d.ts +2 -0
- package/lib/dataStoreRuntime.d.ts.map +1 -1
- package/lib/dataStoreRuntime.js +62 -44
- package/lib/dataStoreRuntime.js.map +1 -1
- package/lib/packageVersion.d.ts +1 -1
- package/lib/packageVersion.js +1 -1
- package/lib/packageVersion.js.map +1 -1
- package/package.json +23 -19
- package/src/dataStoreLayerCompatState.ts +1 -1
- package/src/dataStoreRuntime.ts +68 -49
- package/src/packageVersion.ts +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluidframework/datastore",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.72.0",
|
|
4
4
|
"description": "Fluid data store implementation",
|
|
5
5
|
"homepage": "https://fluidframework.com",
|
|
6
6
|
"repository": {
|
|
@@ -69,29 +69,29 @@
|
|
|
69
69
|
"temp-directory": "nyc/.nyc_output"
|
|
70
70
|
},
|
|
71
71
|
"dependencies": {
|
|
72
|
-
"@fluid-internal/client-utils": "~2.
|
|
73
|
-
"@fluidframework/container-definitions": "~2.
|
|
74
|
-
"@fluidframework/core-interfaces": "~2.
|
|
75
|
-
"@fluidframework/core-utils": "~2.
|
|
76
|
-
"@fluidframework/datastore-definitions": "~2.
|
|
77
|
-
"@fluidframework/driver-definitions": "~2.
|
|
78
|
-
"@fluidframework/driver-utils": "~2.
|
|
79
|
-
"@fluidframework/id-compressor": "~2.
|
|
80
|
-
"@fluidframework/runtime-definitions": "~2.
|
|
81
|
-
"@fluidframework/runtime-utils": "~2.
|
|
82
|
-
"@fluidframework/telemetry-utils": "~2.
|
|
72
|
+
"@fluid-internal/client-utils": "~2.72.0",
|
|
73
|
+
"@fluidframework/container-definitions": "~2.72.0",
|
|
74
|
+
"@fluidframework/core-interfaces": "~2.72.0",
|
|
75
|
+
"@fluidframework/core-utils": "~2.72.0",
|
|
76
|
+
"@fluidframework/datastore-definitions": "~2.72.0",
|
|
77
|
+
"@fluidframework/driver-definitions": "~2.72.0",
|
|
78
|
+
"@fluidframework/driver-utils": "~2.72.0",
|
|
79
|
+
"@fluidframework/id-compressor": "~2.72.0",
|
|
80
|
+
"@fluidframework/runtime-definitions": "~2.72.0",
|
|
81
|
+
"@fluidframework/runtime-utils": "~2.72.0",
|
|
82
|
+
"@fluidframework/telemetry-utils": "~2.72.0",
|
|
83
83
|
"uuid": "^11.1.0"
|
|
84
84
|
},
|
|
85
85
|
"devDependencies": {
|
|
86
86
|
"@arethetypeswrong/cli": "^0.17.1",
|
|
87
87
|
"@biomejs/biome": "~1.9.3",
|
|
88
|
-
"@fluid-internal/mocha-test-setup": "~2.
|
|
89
|
-
"@fluid-tools/build-cli": "^0.
|
|
88
|
+
"@fluid-internal/mocha-test-setup": "~2.72.0",
|
|
89
|
+
"@fluid-tools/build-cli": "^0.60.0",
|
|
90
90
|
"@fluidframework/build-common": "^2.0.3",
|
|
91
|
-
"@fluidframework/build-tools": "^0.
|
|
92
|
-
"@fluidframework/datastore-previous": "npm:@fluidframework/datastore@2.
|
|
93
|
-
"@fluidframework/eslint-config-fluid": "
|
|
94
|
-
"@fluidframework/test-runtime-utils": "~2.
|
|
91
|
+
"@fluidframework/build-tools": "^0.60.0",
|
|
92
|
+
"@fluidframework/datastore-previous": "npm:@fluidframework/datastore@2.71.0",
|
|
93
|
+
"@fluidframework/eslint-config-fluid": "~2.72.0",
|
|
94
|
+
"@fluidframework/test-runtime-utils": "~2.72.0",
|
|
95
95
|
"@microsoft/api-extractor": "7.52.11",
|
|
96
96
|
"@types/lodash": "^4.14.118",
|
|
97
97
|
"@types/mocha": "^10.0.10",
|
|
@@ -109,7 +109,11 @@
|
|
|
109
109
|
"typescript": "~5.4.5"
|
|
110
110
|
},
|
|
111
111
|
"typeValidation": {
|
|
112
|
-
"broken": {
|
|
112
|
+
"broken": {
|
|
113
|
+
"Class_FluidDataStoreRuntime": {
|
|
114
|
+
"forwardCompat": false
|
|
115
|
+
}
|
|
116
|
+
},
|
|
113
117
|
"entrypoint": "legacy"
|
|
114
118
|
},
|
|
115
119
|
"scripts": {
|
package/src/dataStoreRuntime.ts
CHANGED
|
@@ -244,6 +244,11 @@ export class FluidDataStoreRuntime
|
|
|
244
244
|
return this;
|
|
245
245
|
}
|
|
246
246
|
|
|
247
|
+
private localOpActivity: "applyStashed" | "rollback" | undefined = undefined;
|
|
248
|
+
public get activeLocalOperationActivity(): "applyStashed" | "rollback" | undefined {
|
|
249
|
+
return this.localOpActivity;
|
|
250
|
+
}
|
|
251
|
+
|
|
247
252
|
private _disposed = false;
|
|
248
253
|
public get disposed(): boolean {
|
|
249
254
|
return this._disposed;
|
|
@@ -1326,69 +1331,83 @@ export class FluidDataStoreRuntime
|
|
|
1326
1331
|
localOpMetadata: unknown,
|
|
1327
1332
|
): void {
|
|
1328
1333
|
this.verifyNotClosed();
|
|
1334
|
+
assert(!this.localOpActivity, "localOpActivity must be undefined when entering rollback");
|
|
1335
|
+
this.localOpActivity = "rollback";
|
|
1336
|
+
try {
|
|
1337
|
+
// The op being rolled back was not/will not be submitted, so decrement the count.
|
|
1338
|
+
--this.pendingOpCount.value;
|
|
1329
1339
|
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
const envelope = content as IEnvelope;
|
|
1337
|
-
const channelContext = this.contexts.get(envelope.address);
|
|
1338
|
-
assert(!!channelContext, 0x2ed /* "There should be a channel context for the op" */);
|
|
1340
|
+
switch (type) {
|
|
1341
|
+
case DataStoreMessageType.ChannelOp: {
|
|
1342
|
+
// For Operations, find the right channel and trigger resubmission on it.
|
|
1343
|
+
const envelope = content as IEnvelope;
|
|
1344
|
+
const channelContext = this.contexts.get(envelope.address);
|
|
1345
|
+
assert(!!channelContext, 0x2ed /* "There should be a channel context for the op" */);
|
|
1339
1346
|
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1347
|
+
channelContext.rollback(envelope.contents, localOpMetadata);
|
|
1348
|
+
break;
|
|
1349
|
+
}
|
|
1350
|
+
default: {
|
|
1351
|
+
throw new LoggingError(`Can't rollback ${type} message`);
|
|
1352
|
+
}
|
|
1345
1353
|
}
|
|
1354
|
+
} finally {
|
|
1355
|
+
this.localOpActivity = undefined;
|
|
1346
1356
|
}
|
|
1347
1357
|
}
|
|
1348
1358
|
|
|
1349
1359
|
// TODO: use something other than `any` here
|
|
1350
1360
|
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any
|
|
1351
1361
|
public async applyStashedOp(content: any): Promise<unknown> {
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1362
|
+
assert(
|
|
1363
|
+
!this.localOpActivity,
|
|
1364
|
+
"localOpActivity must be undefined when entering applyStashedOp",
|
|
1365
|
+
);
|
|
1366
|
+
this.localOpActivity = "applyStashed";
|
|
1367
|
+
try {
|
|
1368
|
+
// The op being applied may have been submitted in a previous session, so we increment the count here.
|
|
1369
|
+
// Either the ack will arrive and be processed, or that previous session's connection will end, at which point the op will be resubmitted.
|
|
1370
|
+
++this.pendingOpCount.value;
|
|
1355
1371
|
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1372
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
|
1373
|
+
const type = content?.type as DataStoreMessageType;
|
|
1374
|
+
switch (type) {
|
|
1375
|
+
case DataStoreMessageType.Attach: {
|
|
1376
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
|
1377
|
+
const attachMessage = content.content as IAttachMessage;
|
|
1362
1378
|
|
|
1363
|
-
|
|
1364
|
-
|
|
1379
|
+
const flatBlobs = new Map<string, ArrayBufferLike>();
|
|
1380
|
+
const snapshotTree = buildSnapshotTree(attachMessage.snapshot.entries, flatBlobs);
|
|
1365
1381
|
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1382
|
+
const channelContext = this.createRehydratedLocalChannelContext(
|
|
1383
|
+
attachMessage.id,
|
|
1384
|
+
snapshotTree,
|
|
1385
|
+
flatBlobs,
|
|
1386
|
+
);
|
|
1387
|
+
await channelContext.getChannel();
|
|
1388
|
+
this.contexts.set(attachMessage.id, channelContext);
|
|
1389
|
+
if (this.attachState === AttachState.Detached) {
|
|
1390
|
+
this.localChannelContextQueue.set(attachMessage.id, channelContext);
|
|
1391
|
+
} else {
|
|
1392
|
+
channelContext.makeVisible();
|
|
1393
|
+
this.pendingAttach.add(attachMessage.id);
|
|
1394
|
+
}
|
|
1395
|
+
return;
|
|
1396
|
+
}
|
|
1397
|
+
case DataStoreMessageType.ChannelOp: {
|
|
1398
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
|
1399
|
+
const envelope = content.content as IEnvelope;
|
|
1400
|
+
const channelContext = this.contexts.get(envelope.address);
|
|
1401
|
+
assert(!!channelContext, 0x184 /* "There should be a channel context for the op" */);
|
|
1402
|
+
await channelContext.getChannel();
|
|
1403
|
+
return channelContext.applyStashedOp(envelope.contents);
|
|
1404
|
+
}
|
|
1405
|
+
default: {
|
|
1406
|
+
unreachableCase(type);
|
|
1378
1407
|
}
|
|
1379
|
-
return;
|
|
1380
|
-
}
|
|
1381
|
-
case DataStoreMessageType.ChannelOp: {
|
|
1382
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
|
1383
|
-
const envelope = content.content as IEnvelope;
|
|
1384
|
-
const channelContext = this.contexts.get(envelope.address);
|
|
1385
|
-
assert(!!channelContext, 0x184 /* "There should be a channel context for the op" */);
|
|
1386
|
-
await channelContext.getChannel();
|
|
1387
|
-
return channelContext.applyStashedOp(envelope.contents);
|
|
1388
|
-
}
|
|
1389
|
-
default: {
|
|
1390
|
-
unreachableCase(type);
|
|
1391
1408
|
}
|
|
1409
|
+
} finally {
|
|
1410
|
+
this.localOpActivity = undefined;
|
|
1392
1411
|
}
|
|
1393
1412
|
}
|
|
1394
1413
|
|
package/src/packageVersion.ts
CHANGED