@fluidframework/container-loader 2.0.0-dev.7.4.0.217212 → 2.0.0-dev.7.4.0.221926

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 (71) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/api-extractor.json +0 -3
  3. package/api-report/container-loader.api.md +10 -10
  4. package/dist/connectionStateHandler.cjs +3 -3
  5. package/dist/connectionStateHandler.cjs.map +1 -1
  6. package/dist/connectionStateHandler.d.ts +10 -0
  7. package/dist/connectionStateHandler.d.ts.map +1 -1
  8. package/dist/container-loader-alpha.d.ts +196 -20
  9. package/dist/container-loader-beta.d.ts +18 -0
  10. package/dist/container-loader-public.d.ts +18 -0
  11. package/dist/container-loader-untrimmed.d.ts +10 -10
  12. package/dist/loader.cjs +1 -1
  13. package/dist/loader.cjs.map +1 -1
  14. package/dist/loader.d.ts +9 -9
  15. package/dist/loader.d.ts.map +1 -1
  16. package/dist/packageVersion.cjs +1 -1
  17. package/dist/packageVersion.cjs.map +1 -1
  18. package/dist/packageVersion.d.ts +1 -1
  19. package/dist/protocol.cjs.map +1 -1
  20. package/dist/protocol.d.ts +2 -2
  21. package/lib/audience.d.ts +0 -4
  22. package/lib/audience.d.ts.map +1 -1
  23. package/lib/catchUpMonitor.d.ts.map +1 -1
  24. package/lib/connectionManager.d.ts +1 -1
  25. package/lib/connectionManager.d.ts.map +1 -1
  26. package/lib/connectionStateHandler.d.ts +13 -3
  27. package/lib/connectionStateHandler.d.ts.map +1 -1
  28. package/lib/connectionStateHandler.mjs +3 -3
  29. package/lib/connectionStateHandler.mjs.map +1 -1
  30. package/lib/container-loader-alpha.d.ts +196 -20
  31. package/lib/container-loader-beta.d.ts +18 -0
  32. package/lib/container-loader-public.d.ts +18 -0
  33. package/lib/container-loader-untrimmed.d.ts +10 -10
  34. package/lib/container.d.ts +4 -4
  35. package/lib/container.d.ts.map +1 -1
  36. package/lib/containerContext.d.ts.map +1 -1
  37. package/lib/containerStorageAdapter.d.ts +1 -1
  38. package/lib/containerStorageAdapter.d.ts.map +1 -1
  39. package/lib/contracts.d.ts.map +1 -1
  40. package/lib/debugLogger.d.ts.map +1 -1
  41. package/lib/deltaManager.d.ts +1 -1
  42. package/lib/deltaManager.d.ts.map +1 -1
  43. package/lib/deltaQueue.d.ts.map +1 -1
  44. package/lib/disposal.d.ts.map +1 -1
  45. package/lib/error.d.ts.map +1 -1
  46. package/lib/index.d.ts +6 -6
  47. package/lib/index.d.ts.map +1 -1
  48. package/lib/loader.d.ts +11 -11
  49. package/lib/loader.d.ts.map +1 -1
  50. package/lib/loader.mjs +1 -1
  51. package/lib/loader.mjs.map +1 -1
  52. package/lib/location-redirection-utilities/index.d.ts +1 -1
  53. package/lib/location-redirection-utilities/index.d.ts.map +1 -1
  54. package/lib/location-redirection-utilities/resolveWithLocationRedirection.d.ts.map +1 -1
  55. package/lib/noopHeuristic.d.ts.map +1 -1
  56. package/lib/packageVersion.d.ts +1 -1
  57. package/lib/packageVersion.mjs +1 -1
  58. package/lib/packageVersion.mjs.map +1 -1
  59. package/lib/protocol.d.ts +2 -2
  60. package/lib/protocol.d.ts.map +1 -1
  61. package/lib/protocol.mjs.map +1 -1
  62. package/lib/protocolTreeDocumentStorageService.d.ts.map +1 -1
  63. package/lib/quorum.d.ts +0 -4
  64. package/lib/quorum.d.ts.map +1 -1
  65. package/lib/retriableDocumentStorageService.d.ts.map +1 -1
  66. package/lib/utils.d.ts.map +1 -1
  67. package/package.json +13 -11
  68. package/src/connectionStateHandler.ts +16 -3
  69. package/src/loader.ts +8 -8
  70. package/src/packageVersion.ts +1 -1
  71. package/src/protocol.ts +2 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluidframework/container-loader",
3
- "version": "2.0.0-dev.7.4.0.217212",
3
+ "version": "2.0.0-dev.7.4.0.221926",
4
4
  "description": "Fluid container loader",
5
5
  "homepage": "https://fluidframework.com",
6
6
  "repository": {
@@ -35,15 +35,15 @@
35
35
  "temp-directory": "nyc/.nyc_output"
36
36
  },
37
37
  "dependencies": {
38
- "@fluid-internal/client-utils": "2.0.0-dev.7.4.0.217212",
39
- "@fluidframework/container-definitions": "2.0.0-dev.7.4.0.217212",
40
- "@fluidframework/core-interfaces": "2.0.0-dev.7.4.0.217212",
41
- "@fluidframework/core-utils": "2.0.0-dev.7.4.0.217212",
42
- "@fluidframework/driver-definitions": "2.0.0-dev.7.4.0.217212",
43
- "@fluidframework/driver-utils": "2.0.0-dev.7.4.0.217212",
38
+ "@fluid-internal/client-utils": "2.0.0-dev.7.4.0.221926",
39
+ "@fluidframework/container-definitions": "2.0.0-dev.7.4.0.221926",
40
+ "@fluidframework/core-interfaces": "2.0.0-dev.7.4.0.221926",
41
+ "@fluidframework/core-utils": "2.0.0-dev.7.4.0.221926",
42
+ "@fluidframework/driver-definitions": "2.0.0-dev.7.4.0.221926",
43
+ "@fluidframework/driver-utils": "2.0.0-dev.7.4.0.221926",
44
44
  "@fluidframework/protocol-base": "^2.0.1",
45
45
  "@fluidframework/protocol-definitions": "^3.0.0",
46
- "@fluidframework/telemetry-utils": "2.0.0-dev.7.4.0.217212",
46
+ "@fluidframework/telemetry-utils": "2.0.0-dev.7.4.0.221926",
47
47
  "debug": "^4.3.4",
48
48
  "double-ended-queue": "^2.1.0-0",
49
49
  "events": "^3.1.0",
@@ -51,19 +51,20 @@
51
51
  "uuid": "^9.0.0"
52
52
  },
53
53
  "devDependencies": {
54
- "@fluid-private/test-loader-utils": "2.0.0-dev.7.4.0.217212",
54
+ "@arethetypeswrong/cli": "^0.13.3",
55
+ "@fluid-private/test-loader-utils": "2.0.0-dev.7.4.0.221926",
55
56
  "@fluid-tools/build-cli": "^0.28.0",
56
57
  "@fluidframework/build-common": "^2.0.3",
57
58
  "@fluidframework/build-tools": "^0.28.0",
58
59
  "@fluidframework/container-loader-previous": "npm:@fluidframework/container-loader@2.0.0-internal.7.2.0",
59
60
  "@fluidframework/eslint-config-fluid": "^3.1.0",
60
- "@fluidframework/mocha-test-setup": "2.0.0-dev.7.4.0.217212",
61
+ "@fluidframework/mocha-test-setup": "2.0.0-dev.7.4.0.221926",
61
62
  "@microsoft/api-extractor": "^7.38.3",
62
63
  "@types/debug": "^4.1.5",
63
64
  "@types/double-ended-queue": "^2.1.0",
64
65
  "@types/events": "^3.0.0",
65
66
  "@types/mocha": "^9.1.1",
66
- "@types/node": "^16.18.38",
67
+ "@types/node": "^18.19.0",
67
68
  "@types/sinon": "^7.0.13",
68
69
  "c8": "^7.7.1",
69
70
  "copyfiles": "^2.4.1",
@@ -105,6 +106,7 @@
105
106
  "build:esnext": "tsc-multi --config ../../../common/build/build-common/tsc-multi.esm.json",
106
107
  "build:genver": "gen-version",
107
108
  "build:test": "tsc-multi --config tsc-multi.test.json",
109
+ "check:are-the-types-wrong": "attw --pack",
108
110
  "check:release-tags": "api-extractor run --local --config ./api-extractor-lint.json",
109
111
  "ci:build:docs": "api-extractor run",
110
112
  "clean": "rimraf --glob dist lib \"**/*.tsbuildinfo\" \"**/*.build.log\" _api-extractor-temp nyc",
@@ -312,12 +312,25 @@ class ConnectionStateCatchup extends ConnectionStateHandlerPassThrough {
312
312
  class ConnectionStateHandler implements IConnectionStateHandler {
313
313
  private _connectionState = ConnectionState.Disconnected;
314
314
  private _pendingClientId: string | undefined;
315
+
316
+ /**
317
+ * Tracks that we observe the "leave" op within the timeout for our previous clientId (see comment on ConnectionStateHandler class)
318
+ * ! This ensures we do not switch to a new clientId until we process all potential messages from old clientId
319
+ * ! i.e. We will always see the "leave" op for a client after we have seen all the ops it has sent
320
+ * ! This check helps prevent the same op from being resubmitted by the PendingStateManager upon reconnecting
321
+ */
315
322
  private readonly prevClientLeftTimer: Timer;
323
+
324
+ /**
325
+ * Tracks that we observe our own "join" op within the timeout after receiving a "connected" event from the DeltaManager
326
+ */
316
327
  private readonly joinOpTimer: Timer;
328
+
317
329
  private protocol?: IProtocolHandler;
318
330
  private connection?: IConnectionDetailsInternal;
319
331
  private _clientId?: string;
320
332
 
333
+ /** Track how long we waited to see "leave" op for previous clientId */
321
334
  private waitEvent: PerformanceEvent | undefined;
322
335
 
323
336
  public get connectionState(): ConnectionState {
@@ -453,9 +466,9 @@ class ConnectionStateHandler implements IConnectionStateHandler {
453
466
  0x2e2 /* "Must only wait for leave message when clientId in quorum" */,
454
467
  );
455
468
 
456
- // Move to connected state only if we are in Connecting state, we have seen our join op
457
- // and there is no timer running which means we are not waiting for previous client to leave
458
- // or timeout has occurred while doing so.
469
+ // Move to connected state only if:
470
+ // 1. We have seen our own "join" op (i.e. for this.pendingClientId)
471
+ // 2. There is no "leave" timer running, meaning this is our first connection or the previous client has left (via this.prevClientLeftTimer)
459
472
  if (
460
473
  this.pendingClientId !== this.clientId &&
461
474
  this.hasMember(this.pendingClientId) &&
package/src/loader.ts CHANGED
@@ -6,7 +6,6 @@
6
6
  import { v4 as uuid } from "uuid";
7
7
  import {
8
8
  ITelemetryLoggerExt,
9
- IConfigProviderBase,
10
9
  mixinMonitoringContext,
11
10
  MonitoringContext,
12
11
  PerformanceEvent,
@@ -22,6 +21,7 @@ import {
22
21
  IRequest,
23
22
  IRequestHeader,
24
23
  IResponse,
24
+ IConfigProviderBase,
25
25
  } from "@fluidframework/core-interfaces";
26
26
  import {
27
27
  IContainer,
@@ -114,7 +114,7 @@ export class RelativeLoader implements ILoader {
114
114
  }
115
115
 
116
116
  /**
117
- * @internal
117
+ * @alpha
118
118
  */
119
119
  export interface ILoaderOptions extends ILoaderOptions1 {
120
120
  summarizeProtocolTree?: boolean;
@@ -125,7 +125,7 @@ export interface ILoaderOptions extends ILoaderOptions1 {
125
125
  * {@link @fluidframework/container-definitions#IFluidModuleWithDetails}
126
126
  * to have all the code loading modules in one package. #8193
127
127
  * Encapsulates a module entry point with corresponding code details.
128
- * @internal
128
+ * @alpha
129
129
  */
130
130
  export interface IFluidModuleWithDetails {
131
131
  /** Fluid code module that implements the runtime factory needed to instantiate the container runtime. */
@@ -143,7 +143,7 @@ export interface IFluidModuleWithDetails {
143
143
  * to have code loading modules in one package. #8193
144
144
  * Fluid code loader resolves a code module matching the document schema, i.e. code details, such as
145
145
  * a package name and package version range.
146
- * @internal
146
+ * @alpha
147
147
  */
148
148
  export interface ICodeDetailsLoader extends Partial<IProvideFluidCodeDetailsComparer> {
149
149
  /**
@@ -157,7 +157,7 @@ export interface ICodeDetailsLoader extends Partial<IProvideFluidCodeDetailsComp
157
157
 
158
158
  /**
159
159
  * Services and properties necessary for creating a loader
160
- * @internal
160
+ * @alpha
161
161
  */
162
162
  export interface ILoaderProps {
163
163
  /**
@@ -214,7 +214,7 @@ export interface ILoaderProps {
214
214
 
215
215
  /**
216
216
  * Services and properties used by and exposed by the loader
217
- * @internal
217
+ * @alpha
218
218
  */
219
219
  export interface ILoaderServices {
220
220
  /**
@@ -267,7 +267,7 @@ export interface ILoaderServices {
267
267
  /**
268
268
  * Subset of IDocumentStorageService which only supports createBlob() and readBlob(). This is used to support
269
269
  * blobs in detached containers.
270
- * @internal
270
+ * @alpha
271
271
  */
272
272
  export type IDetachedBlobStorage = Pick<IDocumentStorageService, "createBlob" | "readBlob"> & {
273
273
  size: number;
@@ -307,7 +307,7 @@ export async function requestResolvedObjectFromContainer(
307
307
 
308
308
  /**
309
309
  * Manages Fluid resource loading
310
- * @internal
310
+ * @alpha
311
311
  */
312
312
  export class Loader implements IHostLoader {
313
313
  public readonly services: ILoaderServices;
@@ -6,4 +6,4 @@
6
6
  */
7
7
 
8
8
  export const pkgName = "@fluidframework/container-loader";
9
- export const pkgVersion = "2.0.0-dev.7.4.0.217212";
9
+ export const pkgVersion = "2.0.0-dev.7.4.0.221926";
package/src/protocol.ts CHANGED
@@ -28,7 +28,7 @@ export enum SignalType {
28
28
 
29
29
  /**
30
30
  * Function to be used for creating a protocol handler.
31
- * @internal
31
+ * @alpha
32
32
  */
33
33
  export type ProtocolHandlerBuilder = (
34
34
  attributes: IDocumentAttributes,
@@ -37,7 +37,7 @@ export type ProtocolHandlerBuilder = (
37
37
  ) => IProtocolHandler;
38
38
 
39
39
  /**
40
- * @internal
40
+ * @alpha
41
41
  */
42
42
  export interface IProtocolHandler extends IBaseProtocolHandler {
43
43
  readonly audience: IAudienceOwner;