@fluidframework/test-runtime-utils 2.74.0 → 2.81.0-374083

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 (37) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/api-report/test-runtime-utils.legacy.beta.api.md +3 -3
  3. package/dist/assertionShortCodesMap.d.ts +27 -6
  4. package/dist/assertionShortCodesMap.d.ts.map +1 -1
  5. package/dist/assertionShortCodesMap.js +28 -7
  6. package/dist/assertionShortCodesMap.js.map +1 -1
  7. package/dist/generateToken.d.ts.map +1 -1
  8. package/dist/generateToken.js +1 -0
  9. package/dist/generateToken.js.map +1 -1
  10. package/dist/mocks.d.ts +3 -2
  11. package/dist/mocks.d.ts.map +1 -1
  12. package/dist/mocks.js +2 -1
  13. package/dist/mocks.js.map +1 -1
  14. package/dist/validateAssertionError.d.ts.map +1 -1
  15. package/dist/validateAssertionError.js +4 -4
  16. package/dist/validateAssertionError.js.map +1 -1
  17. package/eslint.config.mts +4 -4
  18. package/lib/assertionShortCodesMap.d.ts +27 -6
  19. package/lib/assertionShortCodesMap.d.ts.map +1 -1
  20. package/lib/assertionShortCodesMap.js +28 -7
  21. package/lib/assertionShortCodesMap.js.map +1 -1
  22. package/lib/generateToken.d.ts.map +1 -1
  23. package/lib/generateToken.js +1 -0
  24. package/lib/generateToken.js.map +1 -1
  25. package/lib/mocks.d.ts +3 -2
  26. package/lib/mocks.d.ts.map +1 -1
  27. package/lib/mocks.js +2 -1
  28. package/lib/mocks.js.map +1 -1
  29. package/lib/validateAssertionError.d.ts.map +1 -1
  30. package/lib/validateAssertionError.js +1 -1
  31. package/lib/validateAssertionError.js.map +1 -1
  32. package/package.json +24 -24
  33. package/src/assertionShortCodesMap.ts +28 -7
  34. package/src/generateToken.ts +1 -0
  35. package/src/mocks.ts +8 -3
  36. package/src/validateAssertionError.ts +2 -1
  37. package/.eslintrc.cjs +0 -32
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluidframework/test-runtime-utils",
3
- "version": "2.74.0",
3
+ "version": "2.81.0-374083",
4
4
  "description": "Fluid runtime test utilities",
5
5
  "homepage": "https://fluidframework.com",
6
6
  "repository": {
@@ -69,44 +69,44 @@
69
69
  "temp-directory": "nyc/.nyc_output"
70
70
  },
71
71
  "dependencies": {
72
- "@fluid-internal/client-utils": "~2.74.0",
73
- "@fluidframework/container-definitions": "~2.74.0",
74
- "@fluidframework/container-runtime-definitions": "~2.74.0",
75
- "@fluidframework/core-interfaces": "~2.74.0",
76
- "@fluidframework/core-utils": "~2.74.0",
77
- "@fluidframework/datastore-definitions": "~2.74.0",
78
- "@fluidframework/driver-definitions": "~2.74.0",
79
- "@fluidframework/driver-utils": "~2.74.0",
80
- "@fluidframework/id-compressor": "~2.74.0",
81
- "@fluidframework/routerlicious-driver": "~2.74.0",
82
- "@fluidframework/runtime-definitions": "~2.74.0",
83
- "@fluidframework/runtime-utils": "~2.74.0",
84
- "@fluidframework/telemetry-utils": "~2.74.0",
72
+ "@fluid-internal/client-utils": "2.81.0-374083",
73
+ "@fluidframework/container-definitions": "2.81.0-374083",
74
+ "@fluidframework/container-runtime-definitions": "2.81.0-374083",
75
+ "@fluidframework/core-interfaces": "2.81.0-374083",
76
+ "@fluidframework/core-utils": "2.81.0-374083",
77
+ "@fluidframework/datastore-definitions": "2.81.0-374083",
78
+ "@fluidframework/driver-definitions": "2.81.0-374083",
79
+ "@fluidframework/driver-utils": "2.81.0-374083",
80
+ "@fluidframework/id-compressor": "2.81.0-374083",
81
+ "@fluidframework/routerlicious-driver": "2.81.0-374083",
82
+ "@fluidframework/runtime-definitions": "2.81.0-374083",
83
+ "@fluidframework/runtime-utils": "2.81.0-374083",
84
+ "@fluidframework/telemetry-utils": "2.81.0-374083",
85
85
  "jsrsasign": "^11.0.0",
86
86
  "uuid": "^11.1.0"
87
87
  },
88
88
  "devDependencies": {
89
- "@arethetypeswrong/cli": "^0.17.1",
89
+ "@arethetypeswrong/cli": "^0.18.2",
90
90
  "@biomejs/biome": "~1.9.3",
91
- "@fluid-internal/mocha-test-setup": "~2.74.0",
92
- "@fluid-tools/build-cli": "^0.61.0",
91
+ "@fluid-internal/mocha-test-setup": "2.81.0-374083",
92
+ "@fluid-tools/build-cli": "^0.63.0",
93
93
  "@fluidframework/build-common": "^2.0.3",
94
- "@fluidframework/build-tools": "^0.61.0",
95
- "@fluidframework/eslint-config-fluid": "~2.74.0",
96
- "@fluidframework/test-runtime-utils-previous": "npm:@fluidframework/test-runtime-utils@2.73.0",
94
+ "@fluidframework/build-tools": "^0.63.0",
95
+ "@fluidframework/eslint-config-fluid": "2.81.0-374083",
96
+ "@fluidframework/test-runtime-utils-previous": "npm:@fluidframework/test-runtime-utils@2.80.0",
97
97
  "@microsoft/api-extractor": "7.52.11",
98
98
  "@types/jsrsasign": "^10.5.12",
99
99
  "@types/mocha": "^10.0.10",
100
100
  "@types/node": "^18.19.0",
101
101
  "c8": "^10.1.3",
102
- "concurrently": "^8.2.1",
102
+ "concurrently": "^9.2.1",
103
103
  "copyfiles": "^2.4.1",
104
- "cross-env": "^7.0.3",
105
- "eslint": "~8.57.1",
104
+ "cross-env": "^10.1.0",
105
+ "eslint": "~9.39.1",
106
106
  "jiti": "^2.6.1",
107
107
  "mocha": "^10.8.2",
108
108
  "mocha-multi-reporters": "^1.5.1",
109
- "rimraf": "^4.4.0",
109
+ "rimraf": "^6.1.2",
110
110
  "typescript": "~5.4.5"
111
111
  },
112
112
  "typeValidation": {
@@ -739,6 +739,7 @@ export const shortCodeMap = {
739
739
  "0x583": "unexpected field length",
740
740
  "0x584": "response should contain epoch",
741
741
  "0x585": "prefetched snapshot should have a valid epoch",
742
+ "0x587": "Unreachable unless manually accumulating a batch",
742
743
  "0x58a": "Batch must have a reference sequence number if non-empty",
743
744
  "0x58b": "Content offset within bounds",
744
745
  "0x58c": "Content offset equal or larger than content length",
@@ -1009,7 +1010,6 @@ export const shortCodeMap = {
1009
1010
  "0x7a2": "Must be in a field in order to attach",
1010
1011
  "0x7a5": "Must be in a field in order to detach",
1011
1012
  "0x7a8": "should be in fields",
1012
- "0x7a9": "Collision during index update",
1013
1013
  "0x7aa": "Unknown removed node ID",
1014
1014
  "0x7af": "Destination must be a new empty detached field",
1015
1015
  "0x7b6": "Attach source field must be different from current field",
@@ -1287,14 +1287,10 @@ export const shortCodeMap = {
1287
1287
  "0x9aa": "identifier must be type string",
1288
1288
  "0x9ab": "childId is undefined in unpackChildNodesUsedRoutes",
1289
1289
  "0x9ad": "previous ordinal should not be empty",
1290
- "0x9af": "A view cannot be rebased while it has a pending transaction",
1291
- "0x9b0": "Views cannot be merged into a view while it has a pending transaction",
1292
1290
  "0x9b1": "Expected tree node to have kernel",
1293
1291
  "0x9b4": "Unexpected flex node implementation",
1294
1292
  "0x9b5": "Inheritance should work",
1295
1293
  "0x9b6": "No error to clear",
1296
- "0x9b8": "Inconsistent data: missing detached node entry",
1297
- "0x9b9": "Inconsistent data: missing node entry in latestRelevantRevision",
1298
1294
  "0x9ba": "Unable to delete unknown entry",
1299
1295
  "0x9bb": "Unable to delete unknown entry",
1300
1296
  "0x9bc": "detached node id does not exist in the detached field index",
@@ -1380,6 +1376,8 @@ export const shortCodeMap = {
1380
1376
  "0xa33": "clientId (from stateHandler) could only be undefined if we've never connected, but we have a CSN so we know that's not the case",
1381
1377
  "0xa34": "Should have found the batchId in batchIdBySeqNum map",
1382
1378
  "0xa35": "batchIdsAll and batchIdsBySeqNum should be in sync",
1379
+ "0xa3a": "Presence received signal without clientId",
1380
+ "0xa3c": "Already have entry for key in map",
1383
1381
  "0xa3d": "Partial batch should have exactly one message",
1384
1382
  "0xa3e": "Empty batch is always considered a full batch",
1385
1383
  "0xa3f": "segments cannot be undefined",
@@ -1402,6 +1400,8 @@ export const shortCodeMap = {
1402
1400
  "0xa54": "out of schema: unexpected value",
1403
1401
  "0xa55": "missing simple tree context",
1404
1402
  "0xa57": "Expected EagerMapTree required field to have a value",
1403
+ "0xa59": "Client connected without clientId",
1404
+ "0xa5a": "Mismatched SessionId",
1405
1405
  "0xa5b": "must have exactly 1 field in batch",
1406
1406
  "0xa5c": "Unexpected view implementation",
1407
1407
  "0xa5d": "Shared branches cannot be rebased onto another branch.",
@@ -1440,7 +1440,6 @@ export const shortCodeMap = {
1440
1440
  "0xa94": "invalid forbidden field",
1441
1441
  "0xa95": "Invalid map schema",
1442
1442
  "0xa97": "Not in transaction",
1443
- "0xa98": "Expected transaction branch",
1444
1443
  "0xa99": "must have a parent",
1445
1444
  "0xa9a": "must have a parent",
1446
1445
  "0xa9b": "attach should happen in a node",
@@ -1459,6 +1458,7 @@ export const shortCodeMap = {
1459
1458
  "0xaaa": "All local changes should be applied to the trunk before loading from summary",
1460
1459
  "0xaab": "must be segment leaf",
1461
1460
  "0xaac": "must have removedClient ids",
1461
+ "0xaad": "Local client should be 'Disconnected' before adding new connection.",
1462
1462
  "0xaae": "Maps should have the same behavior",
1463
1463
  "0xaaf": "Unexpected undefined code point",
1464
1464
  "0xab1": "Debug asserts cannot be configured since they have been optimized out.",
@@ -1895,5 +1895,26 @@ export const shortCodeMap = {
1895
1895
  "0xca8": "missing schema",
1896
1896
  "0xca9": "missing schema",
1897
1897
  "0xcaa": "Reachable schema missing from input TreeSchema",
1898
- "0xcab": "missing kind"
1898
+ "0xcab": "missing kind",
1899
+ "0xcac": "Unexpected branch implementation",
1900
+ "0xcad": "Unexpected branch implementation",
1901
+ "0xcae": "The outer transaction should be ending",
1902
+ "0xcaf": "Unexpected commit in transaction",
1903
+ "0xcb0": "must initializeData first",
1904
+ "0xcb1": "Presence is only expected to be accessed with a single version.",
1905
+ "0xcb2": "Presence is only expected to be accessed with a single version.",
1906
+ "0xcb3": "Node cannot be raw.",
1907
+ "0xcb4": "Unexpected node kind",
1908
+ "0xcb5": "Node cannot be raw.",
1909
+ "0xcb6": "Expected node to be on new fork.",
1910
+ "0xcb7": "Unexpected node schema",
1911
+ "0xcb8": "No config map entry for version",
1912
+ "0xcb9": "Invalid package version",
1913
+ "0xcba": "Self is not in audience and no alternateProvider given",
1914
+ "0xcbb": "Client connection update missing",
1915
+ "0xcbc": "Unrecognized message type in critical message",
1916
+ "0xcbd": "Received signal without clientId",
1917
+ "0xcbe": "Acknowledgment message was requested while targeted signal capability is not supported",
1918
+ "0xcbf": "Received signal without clientId",
1919
+ "0xcc0": "Local client must be in audience for presence to handle added connection."
1899
1920
  };
@@ -59,6 +59,7 @@ export function generateToken(
59
59
  lifetime: number = 60 * 60,
60
60
  ver: string = "1.0",
61
61
  ): string {
62
+ // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing -- using ?? could change behavior for falsy values
62
63
  let userClaim = user ? user : generateUser();
63
64
  if (userClaim.id === "" || userClaim.id === undefined) {
64
65
  userClaim = generateUser();
package/src/mocks.ts CHANGED
@@ -115,7 +115,7 @@ export class MockDeltaConnection implements IDeltaConnection {
115
115
  this.handler?.processMessages?.(messageCollection);
116
116
  }
117
117
 
118
- public reSubmit(content: any, localOpMetadata: unknown, squash?: boolean): void {
118
+ public reSubmit(content: any, localOpMetadata: unknown, squash: boolean): void {
119
119
  this.handler?.reSubmit(content, localOpMetadata, squash);
120
120
  }
121
121
 
@@ -426,7 +426,11 @@ export class MockContainerRuntime extends TypedEventEmitter<IContainerRuntimeEve
426
426
  if (pendingMessage.content.type === "idAllocation") {
427
427
  this.submit(pendingMessage.content, pendingMessage.localOpMetadata);
428
428
  } else {
429
- this.dataStoreRuntime.reSubmit(pendingMessage.content, pendingMessage.localOpMetadata);
429
+ this.dataStoreRuntime.reSubmit(
430
+ pendingMessage.content,
431
+ pendingMessage.localOpMetadata,
432
+ false,
433
+ );
430
434
  }
431
435
  });
432
436
  }
@@ -851,6 +855,7 @@ const attachStatesToComparableNumbers = {
851
855
  /**
852
856
  * Mock implementation of IRuntime for testing that does nothing
853
857
  * @legacy @beta
858
+ * @sealed
854
859
  */
855
860
  export class MockFluidDataStoreRuntime
856
861
  extends EventEmitter
@@ -1191,7 +1196,7 @@ export class MockFluidDataStoreRuntime
1191
1196
  return null as any as IResponse;
1192
1197
  }
1193
1198
 
1194
- public reSubmit(content: any, localOpMetadata: unknown, squash?: boolean): void {
1199
+ public reSubmit(content: any, localOpMetadata: unknown, squash: boolean): void {
1195
1200
  this.deltaConnections.forEach((dc) => {
1196
1201
  dc.reSubmit(content, localOpMetadata, squash);
1197
1202
  });
@@ -3,8 +3,9 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
 
6
- import { UsageError } from "@fluidframework/telemetry-utils/internal";
7
6
  import { assert } from "@fluidframework/core-utils/internal";
7
+ import { UsageError } from "@fluidframework/telemetry-utils/internal";
8
+
8
9
  import { shortCodeMap } from "./assertionShortCodesMap.js";
9
10
 
10
11
  /**
package/.eslintrc.cjs DELETED
@@ -1,32 +0,0 @@
1
- /*!
2
- * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
- * Licensed under the MIT License.
4
- */
5
-
6
- module.exports = {
7
- extends: [
8
- require.resolve("@fluidframework/eslint-config-fluid/minimal-deprecated"),
9
- "prettier",
10
- ],
11
- parserOptions: {
12
- project: ["./tsconfig.json", "./src/test/tsconfig.json"],
13
- },
14
- rules: {
15
- "@typescript-eslint/strict-boolean-expressions": "off",
16
- },
17
- overrides: [
18
- {
19
- // The assertion shortcode map file is auto-generated, so disable some rules.
20
- files: ["src/assertionShortCodesMap.ts"],
21
- rules: {
22
- "@typescript-eslint/comma-dangle": "off",
23
- },
24
- },
25
- {
26
- files: ["src/test/**"],
27
- rules: {
28
- "import-x/no-nodejs-modules": "off",
29
- },
30
- },
31
- ],
32
- };