@fluidframework/container-loader 0.59.4000 → 1.0.1

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 (100) hide show
  1. package/.eslintrc.js +1 -1
  2. package/README.md +1 -1
  3. package/dist/connectionState.d.ts +15 -3
  4. package/dist/connectionState.d.ts.map +1 -1
  5. package/dist/connectionState.js +15 -3
  6. package/dist/connectionState.js.map +1 -1
  7. package/dist/connectionStateHandler.d.ts +6 -4
  8. package/dist/connectionStateHandler.d.ts.map +1 -1
  9. package/dist/connectionStateHandler.js +21 -6
  10. package/dist/connectionStateHandler.js.map +1 -1
  11. package/dist/container.d.ts +18 -26
  12. package/dist/container.d.ts.map +1 -1
  13. package/dist/container.js +54 -88
  14. package/dist/container.js.map +1 -1
  15. package/dist/containerContext.d.ts +6 -4
  16. package/dist/containerContext.d.ts.map +1 -1
  17. package/dist/containerContext.js +8 -7
  18. package/dist/containerContext.js.map +1 -1
  19. package/dist/containerStorageAdapter.d.ts +2 -3
  20. package/dist/containerStorageAdapter.d.ts.map +1 -1
  21. package/dist/containerStorageAdapter.js +0 -3
  22. package/dist/containerStorageAdapter.js.map +1 -1
  23. package/dist/deltaManagerProxy.d.ts +0 -1
  24. package/dist/deltaManagerProxy.d.ts.map +1 -1
  25. package/dist/deltaManagerProxy.js +0 -3
  26. package/dist/deltaManagerProxy.js.map +1 -1
  27. package/dist/index.d.ts +1 -1
  28. package/dist/index.d.ts.map +1 -1
  29. package/dist/index.js.map +1 -1
  30. package/dist/loader.d.ts +1 -13
  31. package/dist/loader.d.ts.map +1 -1
  32. package/dist/loader.js +2 -3
  33. package/dist/loader.js.map +1 -1
  34. package/dist/packageVersion.d.ts +1 -1
  35. package/dist/packageVersion.d.ts.map +1 -1
  36. package/dist/packageVersion.js +1 -1
  37. package/dist/packageVersion.js.map +1 -1
  38. package/dist/protocolTreeDocumentStorageService.d.ts +0 -1
  39. package/dist/protocolTreeDocumentStorageService.d.ts.map +1 -1
  40. package/dist/protocolTreeDocumentStorageService.js +0 -1
  41. package/dist/protocolTreeDocumentStorageService.js.map +1 -1
  42. package/dist/retriableDocumentStorageService.d.ts +1 -2
  43. package/dist/retriableDocumentStorageService.d.ts.map +1 -1
  44. package/dist/retriableDocumentStorageService.js +0 -3
  45. package/dist/retriableDocumentStorageService.js.map +1 -1
  46. package/lib/connectionState.d.ts +15 -3
  47. package/lib/connectionState.d.ts.map +1 -1
  48. package/lib/connectionState.js +15 -3
  49. package/lib/connectionState.js.map +1 -1
  50. package/lib/connectionStateHandler.d.ts +6 -4
  51. package/lib/connectionStateHandler.d.ts.map +1 -1
  52. package/lib/connectionStateHandler.js +21 -6
  53. package/lib/connectionStateHandler.js.map +1 -1
  54. package/lib/container.d.ts +18 -26
  55. package/lib/container.d.ts.map +1 -1
  56. package/lib/container.js +54 -88
  57. package/lib/container.js.map +1 -1
  58. package/lib/containerContext.d.ts +6 -4
  59. package/lib/containerContext.d.ts.map +1 -1
  60. package/lib/containerContext.js +8 -7
  61. package/lib/containerContext.js.map +1 -1
  62. package/lib/containerStorageAdapter.d.ts +2 -3
  63. package/lib/containerStorageAdapter.d.ts.map +1 -1
  64. package/lib/containerStorageAdapter.js +0 -3
  65. package/lib/containerStorageAdapter.js.map +1 -1
  66. package/lib/deltaManagerProxy.d.ts +0 -1
  67. package/lib/deltaManagerProxy.d.ts.map +1 -1
  68. package/lib/deltaManagerProxy.js +0 -3
  69. package/lib/deltaManagerProxy.js.map +1 -1
  70. package/lib/index.d.ts +1 -1
  71. package/lib/index.d.ts.map +1 -1
  72. package/lib/index.js.map +1 -1
  73. package/lib/loader.d.ts +1 -13
  74. package/lib/loader.d.ts.map +1 -1
  75. package/lib/loader.js +2 -3
  76. package/lib/loader.js.map +1 -1
  77. package/lib/packageVersion.d.ts +1 -1
  78. package/lib/packageVersion.d.ts.map +1 -1
  79. package/lib/packageVersion.js +1 -1
  80. package/lib/packageVersion.js.map +1 -1
  81. package/lib/protocolTreeDocumentStorageService.d.ts +0 -1
  82. package/lib/protocolTreeDocumentStorageService.d.ts.map +1 -1
  83. package/lib/protocolTreeDocumentStorageService.js +0 -1
  84. package/lib/protocolTreeDocumentStorageService.js.map +1 -1
  85. package/lib/retriableDocumentStorageService.d.ts +1 -2
  86. package/lib/retriableDocumentStorageService.d.ts.map +1 -1
  87. package/lib/retriableDocumentStorageService.js +0 -3
  88. package/lib/retriableDocumentStorageService.js.map +1 -1
  89. package/package.json +25 -25
  90. package/src/connectionState.ts +20 -6
  91. package/src/connectionStateHandler.ts +29 -8
  92. package/src/container.ts +77 -100
  93. package/src/containerContext.ts +10 -10
  94. package/src/containerStorageAdapter.ts +1 -6
  95. package/src/deltaManagerProxy.ts +0 -4
  96. package/src/index.ts +1 -0
  97. package/src/loader.ts +4 -21
  98. package/src/packageVersion.ts +1 -1
  99. package/src/protocolTreeDocumentStorageService.ts +0 -1
  100. package/src/retriableDocumentStorageService.ts +0 -8
@@ -1 +1 @@
1
- {"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,CAAC,MAAM,OAAO,GAAG,kCAAkC,CAAC;AAC1D,MAAM,CAAC,MAAM,UAAU,GAAG,WAAW,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n *\n * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY\n */\n\nexport const pkgName = \"@fluidframework/container-loader\";\nexport const pkgVersion = \"0.59.4000\";\n"]}
1
+ {"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,CAAC,MAAM,OAAO,GAAG,kCAAkC,CAAC;AAC1D,MAAM,CAAC,MAAM,UAAU,GAAG,OAAO,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n *\n * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY\n */\n\nexport const pkgName = \"@fluidframework/container-loader\";\nexport const pkgVersion = \"1.0.1\";\n"]}
@@ -14,7 +14,6 @@ export declare class ProtocolTreeStorageService implements IDocumentStorageServi
14
14
  get disposed(): boolean;
15
15
  getSnapshotTree: (version?: import("@fluidframework/protocol-definitions").IVersion | undefined) => Promise<import("@fluidframework/protocol-definitions").ISnapshotTree | null>;
16
16
  getVersions: (versionId: string | null, count: number) => Promise<import("@fluidframework/protocol-definitions").IVersion[]>;
17
- write: (root: import("@fluidframework/protocol-definitions").ITree, parents: string[], message: string, ref: string) => Promise<import("@fluidframework/protocol-definitions").IVersion>;
18
17
  createBlob: (file: ArrayBufferLike) => Promise<import("@fluidframework/protocol-definitions").ICreateBlobResponse>;
19
18
  readBlob: (id: string) => Promise<ArrayBufferLike>;
20
19
  downloadSummary: (handle: import("@fluidframework/protocol-definitions").ISummaryHandle) => Promise<ISummaryTree>;
@@ -1 +1 @@
1
- {"version":3,"file":"protocolTreeDocumentStorageService.d.ts","sourceRoot":"","sources":["../src/protocolTreeDocumentStorageService.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,oCAAoC,CAAC;AACjE,OAAO,EACH,uBAAuB,EACvB,eAAe,EAClB,MAAM,oCAAoC,CAAC;AAE5C,OAAO,EACH,YAAY,EACf,MAAM,sCAAsC,CAAC;AAE9C,qBAAa,0BAA2B,YAAW,uBAAuB,EAAE,WAAW;IAE/E,OAAO,CAAC,QAAQ,CAAC,sBAAsB;IACvC,OAAO,CAAC,QAAQ,CAAC,oBAAoB;gBADpB,sBAAsB,EAAE,uBAAuB,GAAG,WAAW,EAC7D,oBAAoB,EAAE,MAAM,YAAY;IAG7D,IAAW,QAAQ,6FAElB;IACD,IAAW,aAAa,WAEvB;IACD,IAAW,QAAQ,YAElB;IAED,eAAe,kKAAiF;IAChG,WAAW,kHAA6E;IACxF,KAAK,oLAAuE;IAC5E,UAAU,yGAA4E;IACtF,QAAQ,2CAA0E;IAClF,eAAe,mGAAiF;IAChG,OAAO,sCAAyE;IAE1E,wBAAwB,CAAC,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,eAAe,GAAG,OAAO,CAAC,MAAM,CAAC;CAMnG"}
1
+ {"version":3,"file":"protocolTreeDocumentStorageService.d.ts","sourceRoot":"","sources":["../src/protocolTreeDocumentStorageService.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,oCAAoC,CAAC;AACjE,OAAO,EACH,uBAAuB,EACvB,eAAe,EAClB,MAAM,oCAAoC,CAAC;AAE5C,OAAO,EACH,YAAY,EACf,MAAM,sCAAsC,CAAC;AAE9C,qBAAa,0BAA2B,YAAW,uBAAuB,EAAE,WAAW;IAE/E,OAAO,CAAC,QAAQ,CAAC,sBAAsB;IACvC,OAAO,CAAC,QAAQ,CAAC,oBAAoB;gBADpB,sBAAsB,EAAE,uBAAuB,GAAG,WAAW,EAC7D,oBAAoB,EAAE,MAAM,YAAY;IAG7D,IAAW,QAAQ,6FAElB;IACD,IAAW,aAAa,WAEvB;IACD,IAAW,QAAQ,YAElB;IAED,eAAe,kKAAiF;IAChG,WAAW,kHAA6E;IACxF,UAAU,yGAA4E;IACtF,QAAQ,2CAA0E;IAClF,eAAe,mGAAiF;IAChG,OAAO,sCAAyE;IAE1E,wBAAwB,CAAC,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,eAAe,GAAG,OAAO,CAAC,MAAM,CAAC;CAMnG"}
@@ -9,7 +9,6 @@ export class ProtocolTreeStorageService {
9
9
  this.generateProtocolTree = generateProtocolTree;
10
10
  this.getSnapshotTree = this.internalStorageService.getSnapshotTree.bind(this.internalStorageService);
11
11
  this.getVersions = this.internalStorageService.getVersions.bind(this.internalStorageService);
12
- this.write = this.internalStorageService.write.bind(this.internalStorageService);
13
12
  this.createBlob = this.internalStorageService.createBlob.bind(this.internalStorageService);
14
13
  this.readBlob = this.internalStorageService.readBlob.bind(this.internalStorageService);
15
14
  this.downloadSummary = this.internalStorageService.downloadSummary.bind(this.internalStorageService);
@@ -1 +1 @@
1
- {"version":3,"file":"protocolTreeDocumentStorageService.js","sourceRoot":"","sources":["../src/protocolTreeDocumentStorageService.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAOH,OAAO,EAAE,4BAA4B,EAAE,MAAM,8BAA8B,CAAC;AAK5E,MAAM,OAAO,0BAA0B;IACnC,YACqB,sBAA6D,EAC7D,oBAAwC;QADxC,2BAAsB,GAAtB,sBAAsB,CAAuC;QAC7D,yBAAoB,GAApB,oBAAoB,CAAoB;QAa7D,oBAAe,GAAG,IAAI,CAAC,sBAAsB,CAAC,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,sBAAsB,CAAC,CAAC;QAChG,gBAAW,GAAG,IAAI,CAAC,sBAAsB,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,sBAAsB,CAAC,CAAC;QACxF,UAAK,GAAG,IAAI,CAAC,sBAAsB,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,sBAAsB,CAAC,CAAC;QAC5E,eAAU,GAAG,IAAI,CAAC,sBAAsB,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,sBAAsB,CAAC,CAAC;QACtF,aAAQ,GAAG,IAAI,CAAC,sBAAsB,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,sBAAsB,CAAC,CAAC;QAClF,oBAAe,GAAG,IAAI,CAAC,sBAAsB,CAAC,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,sBAAsB,CAAC,CAAC;QAChG,YAAO,GAAG,IAAI,CAAC,sBAAsB,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,sBAAsB,CAAC,CAAC;IAjBhF,CAAC;IACD,IAAW,QAAQ;QACf,OAAO,IAAI,CAAC,sBAAsB,CAAC,QAAQ,CAAC;IAChD,CAAC;IACD,IAAW,aAAa;QACpB,OAAO,IAAI,CAAC,sBAAsB,CAAC,aAAa,CAAC;IACrD,CAAC;IACD,IAAW,QAAQ;QACf,OAAO,IAAI,CAAC,sBAAsB,CAAC,QAAQ,CAAC;IAChD,CAAC;IAUD,KAAK,CAAC,wBAAwB,CAAC,OAAqB,EAAE,OAAwB;QAC1E,OAAO,IAAI,CAAC,sBAAsB,CAAC,wBAAwB,CACvD,4BAA4B,CAAC,OAAO,EAAE,IAAI,CAAC,oBAAoB,EAAE,CAAC,EAClE,OAAO,CACV,CAAC;IACN,CAAC;CACJ","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { IDisposable } from \"@fluidframework/common-definitions\";\nimport {\n IDocumentStorageService,\n ISummaryContext,\n} from \"@fluidframework/driver-definitions\";\nimport { combineAppAndProtocolSummary } from \"@fluidframework/driver-utils\";\nimport {\n ISummaryTree,\n} from \"@fluidframework/protocol-definitions\";\n\nexport class ProtocolTreeStorageService implements IDocumentStorageService, IDisposable {\n constructor(\n private readonly internalStorageService: IDocumentStorageService & IDisposable,\n private readonly generateProtocolTree: () => ISummaryTree,\n ) {\n }\n public get policies() {\n return this.internalStorageService.policies;\n }\n public get repositoryUrl() {\n return this.internalStorageService.repositoryUrl;\n }\n public get disposed() {\n return this.internalStorageService.disposed;\n }\n\n getSnapshotTree = this.internalStorageService.getSnapshotTree.bind(this.internalStorageService);\n getVersions = this.internalStorageService.getVersions.bind(this.internalStorageService);\n write = this.internalStorageService.write.bind(this.internalStorageService);\n createBlob = this.internalStorageService.createBlob.bind(this.internalStorageService);\n readBlob = this.internalStorageService.readBlob.bind(this.internalStorageService);\n downloadSummary = this.internalStorageService.downloadSummary.bind(this.internalStorageService);\n dispose = this.internalStorageService.dispose.bind(this.internalStorageService);\n\n async uploadSummaryWithContext(summary: ISummaryTree, context: ISummaryContext): Promise<string> {\n return this.internalStorageService.uploadSummaryWithContext(\n combineAppAndProtocolSummary(summary, this.generateProtocolTree()),\n context,\n );\n }\n}\n"]}
1
+ {"version":3,"file":"protocolTreeDocumentStorageService.js","sourceRoot":"","sources":["../src/protocolTreeDocumentStorageService.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAOH,OAAO,EAAE,4BAA4B,EAAE,MAAM,8BAA8B,CAAC;AAK5E,MAAM,OAAO,0BAA0B;IACnC,YACqB,sBAA6D,EAC7D,oBAAwC;QADxC,2BAAsB,GAAtB,sBAAsB,CAAuC;QAC7D,yBAAoB,GAApB,oBAAoB,CAAoB;QAa7D,oBAAe,GAAG,IAAI,CAAC,sBAAsB,CAAC,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,sBAAsB,CAAC,CAAC;QAChG,gBAAW,GAAG,IAAI,CAAC,sBAAsB,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,sBAAsB,CAAC,CAAC;QACxF,eAAU,GAAG,IAAI,CAAC,sBAAsB,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,sBAAsB,CAAC,CAAC;QACtF,aAAQ,GAAG,IAAI,CAAC,sBAAsB,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,sBAAsB,CAAC,CAAC;QAClF,oBAAe,GAAG,IAAI,CAAC,sBAAsB,CAAC,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,sBAAsB,CAAC,CAAC;QAChG,YAAO,GAAG,IAAI,CAAC,sBAAsB,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,sBAAsB,CAAC,CAAC;IAhBhF,CAAC;IACD,IAAW,QAAQ;QACf,OAAO,IAAI,CAAC,sBAAsB,CAAC,QAAQ,CAAC;IAChD,CAAC;IACD,IAAW,aAAa;QACpB,OAAO,IAAI,CAAC,sBAAsB,CAAC,aAAa,CAAC;IACrD,CAAC;IACD,IAAW,QAAQ;QACf,OAAO,IAAI,CAAC,sBAAsB,CAAC,QAAQ,CAAC;IAChD,CAAC;IASD,KAAK,CAAC,wBAAwB,CAAC,OAAqB,EAAE,OAAwB;QAC1E,OAAO,IAAI,CAAC,sBAAsB,CAAC,wBAAwB,CACvD,4BAA4B,CAAC,OAAO,EAAE,IAAI,CAAC,oBAAoB,EAAE,CAAC,EAClE,OAAO,CACV,CAAC;IACN,CAAC;CACJ","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { IDisposable } from \"@fluidframework/common-definitions\";\nimport {\n IDocumentStorageService,\n ISummaryContext,\n} from \"@fluidframework/driver-definitions\";\nimport { combineAppAndProtocolSummary } from \"@fluidframework/driver-utils\";\nimport {\n ISummaryTree,\n} from \"@fluidframework/protocol-definitions\";\n\nexport class ProtocolTreeStorageService implements IDocumentStorageService, IDisposable {\n constructor(\n private readonly internalStorageService: IDocumentStorageService & IDisposable,\n private readonly generateProtocolTree: () => ISummaryTree,\n ) {\n }\n public get policies() {\n return this.internalStorageService.policies;\n }\n public get repositoryUrl() {\n return this.internalStorageService.repositoryUrl;\n }\n public get disposed() {\n return this.internalStorageService.disposed;\n }\n\n getSnapshotTree = this.internalStorageService.getSnapshotTree.bind(this.internalStorageService);\n getVersions = this.internalStorageService.getVersions.bind(this.internalStorageService);\n createBlob = this.internalStorageService.createBlob.bind(this.internalStorageService);\n readBlob = this.internalStorageService.readBlob.bind(this.internalStorageService);\n downloadSummary = this.internalStorageService.downloadSummary.bind(this.internalStorageService);\n dispose = this.internalStorageService.dispose.bind(this.internalStorageService);\n\n async uploadSummaryWithContext(summary: ISummaryTree, context: ISummaryContext): Promise<string> {\n return this.internalStorageService.uploadSummaryWithContext(\n combineAppAndProtocolSummary(summary, this.generateProtocolTree()),\n context,\n );\n }\n}\n"]}
@@ -3,7 +3,7 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
  import { IDocumentStorageService, IDocumentStorageServicePolicies, ISummaryContext } from "@fluidframework/driver-definitions";
6
- import { ICreateBlobResponse, ISnapshotTree, ISummaryHandle, ISummaryTree, ITree, IVersion } from "@fluidframework/protocol-definitions";
6
+ import { ICreateBlobResponse, ISnapshotTree, ISummaryHandle, ISummaryTree, IVersion } from "@fluidframework/protocol-definitions";
7
7
  import { IDisposable, ITelemetryLogger } from "@fluidframework/common-definitions";
8
8
  export declare class RetriableDocumentStorageService implements IDocumentStorageService, IDisposable {
9
9
  private readonly internalStorageService;
@@ -17,7 +17,6 @@ export declare class RetriableDocumentStorageService implements IDocumentStorage
17
17
  getSnapshotTree(version?: IVersion): Promise<ISnapshotTree | null>;
18
18
  readBlob(id: string): Promise<ArrayBufferLike>;
19
19
  getVersions(versionId: string | null, count: number): Promise<IVersion[]>;
20
- write(tree: ITree, parents: string[], message: string, ref: string): Promise<IVersion>;
21
20
  uploadSummaryWithContext(summary: ISummaryTree, context: ISummaryContext): Promise<string>;
22
21
  downloadSummary(handle: ISummaryHandle): Promise<ISummaryTree>;
23
22
  createBlob(file: ArrayBufferLike): Promise<ICreateBlobResponse>;
@@ -1 +1 @@
1
- {"version":3,"file":"retriableDocumentStorageService.d.ts","sourceRoot":"","sources":["../src/retriableDocumentStorageService.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EACH,uBAAuB,EACvB,+BAA+B,EAC/B,eAAe,EAClB,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EACH,mBAAmB,EACnB,aAAa,EACb,cAAc,EACd,YAAY,EACZ,KAAK,EACL,QAAQ,EACX,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AAGnF,qBAAa,+BAAgC,YAAW,uBAAuB,EAAE,WAAW;IAGpF,OAAO,CAAC,QAAQ,CAAC,sBAAsB;IACvC,OAAO,CAAC,QAAQ,CAAC,MAAM;IAH3B,OAAO,CAAC,SAAS,CAAS;gBAEL,sBAAsB,EAAE,uBAAuB,EAC/C,MAAM,EAAE,gBAAgB;IAI7C,IAAW,QAAQ,IAAI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;IACvC,OAAO,CAAC,QAAQ,CAAC,MAAM;IAH3B,OAAO,CAAC,SAAS,CAAS;gBAEL,sBAAsB,EAAE,uBAAuB,EAC/C,MAAM,EAAE,gBAAgB;IAI7C,IAAW,QAAQ,IAAI,+BAA+B,GAAG,SAAS,CAEjE;IACD,IAAW,QAAQ,YAA6B;IACzC,OAAO;IAId,IAAW,aAAa,IAAI,MAAM,CAEjC;IAEY,eAAe,CAAC,OAAO,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC,aAAa,GAAG,IAAI,CAAC;IAOlE,QAAQ,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,CAAC;IAO9C,WAAW,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,EAAE,CAAC;IAOzE,wBAAwB,CAAC,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,eAAe,GAAG,OAAO,CAAC,MAAM,CAAC;IAuB1F,eAAe,CAAC,MAAM,EAAE,cAAc,GAAG,OAAO,CAAC,YAAY,CAAC;IAO9D,UAAU,CAAC,IAAI,EAAE,eAAe,GAAG,OAAO,CAAC,mBAAmB,CAAC;IAO5E,OAAO,CAAC,oBAAoB;YAQd,YAAY;CAU7B"}
@@ -30,9 +30,6 @@ export class RetriableDocumentStorageService {
30
30
  async getVersions(versionId, count) {
31
31
  return this.runWithRetry(async () => this.internalStorageService.getVersions(versionId, count), "storage_getVersions");
32
32
  }
33
- async write(tree, parents, message, ref) {
34
- return this.runWithRetry(async () => this.internalStorageService.write(tree, parents, message, ref), "storage_write");
35
- }
36
33
  async uploadSummaryWithContext(summary, context) {
37
34
  // Not using retry loop here. Couple reasons:
38
35
  // 1. If client lost connectivity, then retry loop will result in uploading stale summary
@@ -1 +1 @@
1
- {"version":3,"file":"retriableDocumentStorageService.js","sourceRoot":"","sources":["../src/retriableDocumentStorageService.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OA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CACvB,CAAC;IACN,CAAC;IAEO,oBAAoB;QACxB,IAAI,IAAI,CAAC,SAAS,EAAE;YAChB,4DAA4D;YAC5D,MAAM,IAAI,YAAY,CAAC,2CAA2C,EAAE,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC,CAAC;SAC5F;QACD,OAAO,SAAS,CAAC;IACrB,CAAC;IAEO,KAAK,CAAC,YAAY,CAAI,GAAqB,EAAE,QAAgB;QACjE,OAAO,YAAY,CACf,GAAG,EACH,QAAQ,EACR,IAAI,CAAC,MAAM,EACX;YACI,OAAO,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,oBAAoB,EAAE;SAC7C,CACJ,CAAC;IACN,CAAC;CACJ","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert } from \"@fluidframework/common-utils\";\nimport { GenericError } from \"@fluidframework/container-utils\";\nimport {\n IDocumentStorageService,\n IDocumentStorageServicePolicies,\n ISummaryContext,\n} from \"@fluidframework/driver-definitions\";\nimport {\n ICreateBlobResponse,\n ISnapshotTree,\n ISummaryHandle,\n ISummaryTree,\n ITree,\n IVersion,\n} from \"@fluidframework/protocol-definitions\";\nimport { IDisposable, ITelemetryLogger } from \"@fluidframework/common-definitions\";\nimport { runWithRetry } from \"@fluidframework/driver-utils\";\n\nexport class RetriableDocumentStorageService implements IDocumentStorageService, IDisposable {\n private _disposed = false;\n constructor(\n private readonly internalStorageService: IDocumentStorageService,\n private readonly logger: ITelemetryLogger,\n ) {\n }\n\n public get policies(): IDocumentStorageServicePolicies | undefined {\n return this.internalStorageService.policies;\n }\n public get disposed() { return this._disposed; }\n public dispose() {\n this._disposed = true;\n }\n\n public get repositoryUrl(): string {\n return this.internalStorageService.repositoryUrl;\n }\n\n public async getSnapshotTree(version?: IVersion): Promise<ISnapshotTree | null> {\n return this.runWithRetry(\n async () => this.internalStorageService.getSnapshotTree(version),\n \"storage_getSnapshotTree\",\n );\n }\n\n public async readBlob(id: string): Promise<ArrayBufferLike> {\n return this.runWithRetry(\n async () => this.internalStorageService.readBlob(id),\n \"storage_readBlob\",\n );\n }\n\n public async getVersions(versionId: string | null, count: number): Promise<IVersion[]> {\n return this.runWithRetry(\n async () => this.internalStorageService.getVersions(versionId, count),\n \"storage_getVersions\",\n );\n }\n\n public async write(tree: ITree, parents: string[], message: string, ref: string): Promise<IVersion> {\n return this.runWithRetry(\n async () => this.internalStorageService.write(tree, parents, message, ref),\n \"storage_write\",\n );\n }\n\n public async uploadSummaryWithContext(summary: ISummaryTree, context: ISummaryContext): Promise<string> {\n // Not using retry loop here. Couple reasons:\n // 1. If client lost connectivity, then retry loop will result in uploading stale summary\n // by stale summarizer after connectivity comes back. It will cause failures for this client and for\n // real (new) summarizer. This problem in particular should be solved in future by supplying abort handle\n // on all APIs and caller (ContainerRuntime.submitSummary) aborting call on loss of connectivity\n // 2. Similar, if we get 429 with retryAfter = 10 minutes, it's likely not the right call to retry summary\n // upload in 10 minutes - it's better to keep processing ops and retry later. Though caller needs to take\n // retryAfter into account!\n // But retry loop is required for creation flow (Container.attach)\n assert((context.referenceSequenceNumber === 0) === (context.ackHandle === undefined),\n 0x251 /* \"creation summary has to have seq=0 && handle === undefined\" */);\n if (context.referenceSequenceNumber !== 0) {\n return this.internalStorageService.uploadSummaryWithContext(summary, context);\n }\n\n // Creation flow with attachment blobs - need to do retries!\n return this.runWithRetry(\n async () => this.internalStorageService.uploadSummaryWithContext(summary, context),\n \"storage_uploadSummaryWithContext\",\n );\n }\n\n public async downloadSummary(handle: ISummaryHandle): Promise<ISummaryTree> {\n return this.runWithRetry(\n async () => this.internalStorageService.downloadSummary(handle),\n \"storage_downloadSummary\",\n );\n }\n\n public async createBlob(file: ArrayBufferLike): Promise<ICreateBlobResponse> {\n return this.runWithRetry(\n async () => this.internalStorageService.createBlob(file),\n \"storage_createBlob\",\n );\n }\n\n private checkStorageDisposed() {\n if (this._disposed) {\n // pre-0.58 error message: storageServiceDisposedCannotRetry\n throw new GenericError(\"Storage Service is disposed. Cannot retry\", { canRetry: false });\n }\n return undefined;\n }\n\n private async runWithRetry<T>(api: () => Promise<T>, callName: string): Promise<T> {\n return runWithRetry(\n api,\n callName,\n this.logger,\n {\n onRetry: () => this.checkStorageDisposed(),\n },\n );\n }\n}\n"]}
1
+ {"version":3,"file":"retriableDocumentStorageService.js","sourceRoot":"","sources":["../src/retriableDocumentStorageService.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,8BAA8B,CAAC;AACtD,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAc/D,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAE5D,MAAM,OAAO,+BAA+B;IAExC,YACqB,sBAA+C,EAC/C,MAAwB;QADxB,2BAAsB,GAAtB,sBAAsB,CAAyB;QAC/C,WAAM,GAAN,MAAM,CAAkB;QAHrC,cAAS,GAAG,KAAK,CAAC;IAK1B,CAAC;IAED,IAAW,QAAQ;QACf,OAAO,IAAI,CAAC,sBAAsB,CAAC,QAAQ,CAAC;IAChD,CAAC;IACD,IAAW,QAAQ,KAAK,OAAO,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC;IACzC,OAAO;QACV,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC;IAC1B,CAAC;IAED,IAAW,aAAa;QACpB,OAAO,IAAI,CAAC,sBAAsB,CAAC,aAAa,CAAC;IACrD,CAAC;IAEM,KAAK,CAAC,eAAe,CAAC,OAAkB;QAC3C,OAAO,IAAI,CAAC,YAAY,CACpB,KAAK,IAAI,EAAE,CAAC,IAAI,CAAC,sBAAsB,CAAC,eAAe,CAAC,OAAO,CAAC,EAChE,yBAAyB,CAC5B,CAAC;IACN,CAAC;IAEM,KAAK,CAAC,QAAQ,CAAC,EAAU;QAC5B,OAAO,IAAI,CAAC,YAAY,CACpB,KAAK,IAAI,EAAE,CAAC,IAAI,CAAC,sBAAsB,CAAC,QAA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CAAC,UAAU,CAAC,IAAI,CAAC,EACxD,oBAAoB,CACvB,CAAC;IACN,CAAC;IAEO,oBAAoB;QACxB,IAAI,IAAI,CAAC,SAAS,EAAE;YAChB,4DAA4D;YAC5D,MAAM,IAAI,YAAY,CAAC,2CAA2C,EAAE,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC,CAAC;SAC5F;QACD,OAAO,SAAS,CAAC;IACrB,CAAC;IAEO,KAAK,CAAC,YAAY,CAAI,GAAqB,EAAE,QAAgB;QACjE,OAAO,YAAY,CACf,GAAG,EACH,QAAQ,EACR,IAAI,CAAC,MAAM,EACX;YACI,OAAO,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,oBAAoB,EAAE;SAC7C,CACJ,CAAC;IACN,CAAC;CACJ","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert } from \"@fluidframework/common-utils\";\nimport { GenericError } from \"@fluidframework/container-utils\";\nimport {\n IDocumentStorageService,\n IDocumentStorageServicePolicies,\n ISummaryContext,\n} from \"@fluidframework/driver-definitions\";\nimport {\n ICreateBlobResponse,\n ISnapshotTree,\n ISummaryHandle,\n ISummaryTree,\n IVersion,\n} from \"@fluidframework/protocol-definitions\";\nimport { IDisposable, ITelemetryLogger } from \"@fluidframework/common-definitions\";\nimport { runWithRetry } from \"@fluidframework/driver-utils\";\n\nexport class RetriableDocumentStorageService implements IDocumentStorageService, IDisposable {\n private _disposed = false;\n constructor(\n private readonly internalStorageService: IDocumentStorageService,\n private readonly logger: ITelemetryLogger,\n ) {\n }\n\n public get policies(): IDocumentStorageServicePolicies | undefined {\n return this.internalStorageService.policies;\n }\n public get disposed() { return this._disposed; }\n public dispose() {\n this._disposed = true;\n }\n\n public get repositoryUrl(): string {\n return this.internalStorageService.repositoryUrl;\n }\n\n public async getSnapshotTree(version?: IVersion): Promise<ISnapshotTree | null> {\n return this.runWithRetry(\n async () => this.internalStorageService.getSnapshotTree(version),\n \"storage_getSnapshotTree\",\n );\n }\n\n public async readBlob(id: string): Promise<ArrayBufferLike> {\n return this.runWithRetry(\n async () => this.internalStorageService.readBlob(id),\n \"storage_readBlob\",\n );\n }\n\n public async getVersions(versionId: string | null, count: number): Promise<IVersion[]> {\n return this.runWithRetry(\n async () => this.internalStorageService.getVersions(versionId, count),\n \"storage_getVersions\",\n );\n }\n\n public async uploadSummaryWithContext(summary: ISummaryTree, context: ISummaryContext): Promise<string> {\n // Not using retry loop here. Couple reasons:\n // 1. If client lost connectivity, then retry loop will result in uploading stale summary\n // by stale summarizer after connectivity comes back. It will cause failures for this client and for\n // real (new) summarizer. This problem in particular should be solved in future by supplying abort handle\n // on all APIs and caller (ContainerRuntime.submitSummary) aborting call on loss of connectivity\n // 2. Similar, if we get 429 with retryAfter = 10 minutes, it's likely not the right call to retry summary\n // upload in 10 minutes - it's better to keep processing ops and retry later. Though caller needs to take\n // retryAfter into account!\n // But retry loop is required for creation flow (Container.attach)\n assert((context.referenceSequenceNumber === 0) === (context.ackHandle === undefined),\n 0x251 /* \"creation summary has to have seq=0 && handle === undefined\" */);\n if (context.referenceSequenceNumber !== 0) {\n return this.internalStorageService.uploadSummaryWithContext(summary, context);\n }\n\n // Creation flow with attachment blobs - need to do retries!\n return this.runWithRetry(\n async () => this.internalStorageService.uploadSummaryWithContext(summary, context),\n \"storage_uploadSummaryWithContext\",\n );\n }\n\n public async downloadSummary(handle: ISummaryHandle): Promise<ISummaryTree> {\n return this.runWithRetry(\n async () => this.internalStorageService.downloadSummary(handle),\n \"storage_downloadSummary\",\n );\n }\n\n public async createBlob(file: ArrayBufferLike): Promise<ICreateBlobResponse> {\n return this.runWithRetry(\n async () => this.internalStorageService.createBlob(file),\n \"storage_createBlob\",\n );\n }\n\n private checkStorageDisposed() {\n if (this._disposed) {\n // pre-0.58 error message: storageServiceDisposedCannotRetry\n throw new GenericError(\"Storage Service is disposed. Cannot retry\", { canRetry: false });\n }\n return undefined;\n }\n\n private async runWithRetry<T>(api: () => Promise<T>, callName: string): Promise<T> {\n return runWithRetry(\n api,\n callName,\n this.logger,\n {\n onRetry: () => this.checkStorageDisposed(),\n },\n );\n }\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluidframework/container-loader",
3
- "version": "0.59.4000",
3
+ "version": "1.0.1",
4
4
  "description": "Fluid container loader",
5
5
  "homepage": "https://fluidframework.com",
6
6
  "repository": {
@@ -63,14 +63,14 @@
63
63
  "dependencies": {
64
64
  "@fluidframework/common-definitions": "^0.20.1",
65
65
  "@fluidframework/common-utils": "^0.32.1",
66
- "@fluidframework/container-definitions": "^0.48.2000",
67
- "@fluidframework/container-utils": "^0.59.4000",
68
- "@fluidframework/core-interfaces": "^0.43.1000",
69
- "@fluidframework/driver-definitions": "^0.46.2000",
70
- "@fluidframework/driver-utils": "^0.59.4000",
66
+ "@fluidframework/container-definitions": "^1.0.1",
67
+ "@fluidframework/container-utils": "^1.0.1",
68
+ "@fluidframework/core-interfaces": "^1.0.1",
69
+ "@fluidframework/driver-definitions": "^1.0.1",
70
+ "@fluidframework/driver-utils": "^1.0.1",
71
71
  "@fluidframework/protocol-base": "^0.1036.4000",
72
72
  "@fluidframework/protocol-definitions": "^0.1028.2000",
73
- "@fluidframework/telemetry-utils": "^0.59.4000",
73
+ "@fluidframework/telemetry-utils": "^1.0.1",
74
74
  "abort-controller": "^3.0.0",
75
75
  "double-ended-queue": "^2.1.0-0",
76
76
  "lodash": "^4.17.21",
@@ -78,11 +78,11 @@
78
78
  },
79
79
  "devDependencies": {
80
80
  "@fluidframework/build-common": "^0.23.0",
81
- "@fluidframework/build-tools": "^0.2.70857",
81
+ "@fluidframework/build-tools": "^0.2.71273",
82
82
  "@fluidframework/container-loader-previous": "npm:@fluidframework/container-loader@0.59.3000",
83
83
  "@fluidframework/eslint-config-fluid": "^0.28.2000",
84
- "@fluidframework/mocha-test-setup": "^0.59.4000",
85
- "@fluidframework/test-loader-utils": "^0.59.4000",
84
+ "@fluidframework/mocha-test-setup": "^1.0.1",
85
+ "@fluidframework/test-loader-utils": "^1.0.1",
86
86
  "@microsoft/api-extractor": "^7.22.2",
87
87
  "@rushstack/eslint-config": "^2.5.1",
88
88
  "@types/double-ended-queue": "^2.1.0",
@@ -90,23 +90,10 @@
90
90
  "@types/mocha": "^9.1.1",
91
91
  "@types/node": "^14.18.0",
92
92
  "@types/sinon": "^7.0.13",
93
- "@typescript-eslint/eslint-plugin": "~5.9.0",
94
- "@typescript-eslint/parser": "~5.9.0",
95
93
  "concurrently": "^6.2.0",
96
94
  "copyfiles": "^2.1.0",
97
95
  "cross-env": "^7.0.2",
98
96
  "eslint": "~8.6.0",
99
- "eslint-plugin-editorconfig": "~3.2.0",
100
- "eslint-plugin-eslint-comments": "~3.2.0",
101
- "eslint-plugin-import": "~2.25.4",
102
- "eslint-plugin-jest": "~26.1.3",
103
- "eslint-plugin-jsdoc": "~39.3.0",
104
- "eslint-plugin-mocha": "~10.0.3",
105
- "eslint-plugin-promise": "~6.0.0",
106
- "eslint-plugin-react": "~7.28.0",
107
- "eslint-plugin-tsdoc": "~0.2.14",
108
- "eslint-plugin-unicorn": "~40.0.0",
109
- "eslint-plugin-unused-imports": "~2.0.0",
110
97
  "mocha": "^10.0.0",
111
98
  "nyc": "^15.0.0",
112
99
  "rimraf": "^2.6.2",
@@ -115,7 +102,20 @@
115
102
  "typescript-formatter": "7.1.0"
116
103
  },
117
104
  "typeValidation": {
118
- "version": "0.59.4000",
119
- "broken": {}
105
+ "version": "1.0.0",
106
+ "broken": {
107
+ "ClassDeclaration_Container": {
108
+ "backCompat": false
109
+ },
110
+ "EnumDeclaration_ConnectionState": {
111
+ "backCompat": false
112
+ },
113
+ "InterfaceDeclaration_ILoaderServices": {
114
+ "backCompat": false
115
+ },
116
+ "ClassDeclaration_Loader": {
117
+ "backCompat": false
118
+ }
119
+ }
120
120
  }
121
121
  }
@@ -5,17 +5,31 @@
5
5
 
6
6
  export enum ConnectionState {
7
7
  /**
8
- * The document is no longer connected to the delta server
8
+ * The container is not connected to the ordering service
9
+ * Note - When in this state the container may be about to reconnect,
10
+ * or may remain disconnected until explicitly told to connect.
9
11
  */
10
- Disconnected,
12
+ Disconnected = 0,
11
13
 
12
14
  /**
13
- * The document has an inbound connection but is still pending for outbound deltas
15
+ * The container is disconnected but actively trying to establish a new connection
16
+ * PLEASE NOTE that this numerical value falls out of the order you may expect for this state
14
17
  */
15
- Connecting,
18
+ EstablishingConnection = 3,
16
19
 
17
20
  /**
18
- * The document is fully connected
21
+ * @see ConnectionState.CatchingUp, which is the new name for this state.
22
+ * @deprecated - This state itself is not gone, just being renamed. Please use ConnectionState.CatchingUp.
19
23
  */
20
- Connected,
24
+ Connecting = 1,
25
+
26
+ /**
27
+ * The container has an inbound connection only, and is catching up to the latest known state from the service.
28
+ */
29
+ CatchingUp = 1,
30
+
31
+ /**
32
+ * The container is fully connected and syncing
33
+ */
34
+ Connected = 2,
21
35
  }
@@ -4,10 +4,11 @@
4
4
  */
5
5
 
6
6
  import { ITelemetryLogger } from "@fluidframework/common-definitions";
7
+ import { assert, Timer } from "@fluidframework/common-utils";
7
8
  import { IConnectionDetails } from "@fluidframework/container-definitions";
9
+ import { ProtocolOpHandler } from "@fluidframework/protocol-base";
8
10
  import { ConnectionMode, IQuorumClients, ISequencedClient } from "@fluidframework/protocol-definitions";
9
11
  import { PerformanceEvent } from "@fluidframework/telemetry-utils";
10
- import { assert, Timer } from "@fluidframework/common-utils";
11
12
  import { ConnectionState } from "./connectionState";
12
13
 
13
14
  export interface IConnectionStateHandler {
@@ -32,7 +33,6 @@ const JoinOpTimer = 45000;
32
33
  export class ConnectionStateHandler {
33
34
  private _connectionState = ConnectionState.Disconnected;
34
35
  private _pendingClientId: string | undefined;
35
- private _clientId: string | undefined;
36
36
  private readonly prevClientLeftTimer: Timer;
37
37
  private readonly joinOpTimer: Timer;
38
38
 
@@ -57,6 +57,7 @@ export class ConnectionStateHandler {
57
57
  constructor(
58
58
  private readonly handler: IConnectionStateHandler,
59
59
  private readonly logger: ITelemetryLogger,
60
+ private _clientId?: string,
60
61
  ) {
61
62
  this.prevClientLeftTimer = new Timer(
62
63
  // Default is 5 min for which we are going to wait for its own "leave" message. This is same as
@@ -77,7 +78,7 @@ export class ConnectionStateHandler {
77
78
  () => {
78
79
  // I've observed timer firing within couple ms from disconnect event, looks like
79
80
  // queued timer callback is not cancelled if timer is cancelled while callback sits in the queue.
80
- if (this.connectionState === ConnectionState.Connecting) {
81
+ if (this.connectionState === ConnectionState.CatchingUp) {
81
82
  this.handler.logConnectionIssue("NoJoinOp");
82
83
  }
83
84
  },
@@ -108,7 +109,7 @@ export class ConnectionStateHandler {
108
109
  }
109
110
  }
110
111
 
111
- public receivedAddMemberEvent(clientId: string) {
112
+ private receivedAddMemberEvent(clientId: string) {
112
113
  // This is the only one that requires the pending client ID
113
114
  if (clientId === this.pendingClientId) {
114
115
  if (this.joinOpTimer.hasTimer) {
@@ -133,6 +134,11 @@ export class ConnectionStateHandler {
133
134
  private applyForConnectedState(source: "removeMemberEvent" | "addMemberEvent" | "timeout" | "containerSaved") {
134
135
  const quorumClients = this.handler.quorumClients();
135
136
  assert(quorumClients !== undefined, 0x236 /* "In all cases it should be already installed" */);
137
+
138
+ assert(this.prevClientLeftTimer.hasTimer === false ||
139
+ (this.clientId !== undefined && quorumClients.getMember(this.clientId) !== undefined),
140
+ 0x2e2 /* "Must only wait for leave message when clientId in quorum" */);
141
+
136
142
  // Move to connected state only if we are in Connecting state, we have seen our join op
137
143
  // and there is no timer running which means we are not waiting for previous client to leave
138
144
  // or timeout has occured while doing so.
@@ -158,7 +164,7 @@ export class ConnectionStateHandler {
158
164
  }
159
165
  }
160
166
 
161
- public receivedRemoveMemberEvent(clientId: string) {
167
+ private receivedRemoveMemberEvent(clientId: string) {
162
168
  // If the client which has left was us, then finish the timer.
163
169
  if (this.clientId === clientId) {
164
170
  this.prevClientLeftTimer.clear();
@@ -178,7 +184,7 @@ export class ConnectionStateHandler {
178
184
  details: IConnectionDetails,
179
185
  ) {
180
186
  const oldState = this._connectionState;
181
- this._connectionState = ConnectionState.Connecting;
187
+ this._connectionState = ConnectionState.CatchingUp;
182
188
 
183
189
  // Stash the clientID to detect when transitioning from connecting (socket.io channel open) to connected
184
190
  // (have received the join message for the client ID)
@@ -189,7 +195,7 @@ export class ConnectionStateHandler {
189
195
  this._pendingClientId = details.clientId;
190
196
 
191
197
  // Report telemetry after we set client id, but before transitioning to Connected state below!
192
- this.handler.logConnectionStateChangeTelemetry(ConnectionState.Connecting, oldState);
198
+ this.handler.logConnectionStateChangeTelemetry(ConnectionState.CatchingUp, oldState);
193
199
 
194
200
  const quorumClients = this.handler.quorumClients();
195
201
  // Check if we already processed our own join op through delta storage!
@@ -224,7 +230,7 @@ export class ConnectionStateHandler {
224
230
  client = quorumClients?.getMember(this._clientId);
225
231
  }
226
232
  if (value === ConnectionState.Connected) {
227
- assert(oldState === ConnectionState.Connecting,
233
+ assert(oldState === ConnectionState.CatchingUp,
228
234
  0x1d8 /* "Should only transition from Connecting state" */);
229
235
  // Mark our old client should have left in the quorum if it's still there
230
236
  if (client !== undefined) {
@@ -262,4 +268,19 @@ export class ConnectionStateHandler {
262
268
  // Propagate event across layers
263
269
  this.handler.connectionStateChanged();
264
270
  }
271
+
272
+ public initProtocol(protocol: ProtocolOpHandler) {
273
+ protocol.quorum.on("addMember", (clientId, details) => {
274
+ this.receivedAddMemberEvent(clientId);
275
+ });
276
+
277
+ protocol.quorum.on("removeMember", (clientId) => {
278
+ this.receivedRemoveMemberEvent(clientId);
279
+ });
280
+
281
+ // if we have a clientId from a previous container we need to wait for its leave message
282
+ if (this.clientId !== undefined && protocol.quorum.getMember(this.clientId) !== undefined) {
283
+ this.prevClientLeftTimer.restart();
284
+ }
285
+ }
265
286
  }