@fluidframework/container-loader 0.55.1 → 0.56.0-49831

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 (69) hide show
  1. package/dist/connectionStateHandler.d.ts +1 -0
  2. package/dist/connectionStateHandler.d.ts.map +1 -1
  3. package/dist/connectionStateHandler.js +11 -2
  4. package/dist/connectionStateHandler.js.map +1 -1
  5. package/dist/container.d.ts +3 -10
  6. package/dist/container.d.ts.map +1 -1
  7. package/dist/container.js +7 -20
  8. package/dist/container.js.map +1 -1
  9. package/dist/containerContext.d.ts +7 -3
  10. package/dist/containerContext.d.ts.map +1 -1
  11. package/dist/containerContext.js +5 -4
  12. package/dist/containerContext.js.map +1 -1
  13. package/dist/containerStorageAdapter.d.ts +1 -1
  14. package/dist/containerStorageAdapter.d.ts.map +1 -1
  15. package/dist/containerStorageAdapter.js.map +1 -1
  16. package/dist/deltaManager.d.ts +0 -11
  17. package/dist/deltaManager.d.ts.map +1 -1
  18. package/dist/deltaManager.js +0 -13
  19. package/dist/deltaManager.js.map +1 -1
  20. package/dist/deltaManagerProxy.d.ts +0 -1
  21. package/dist/deltaManagerProxy.d.ts.map +1 -1
  22. package/dist/deltaManagerProxy.js +0 -3
  23. package/dist/deltaManagerProxy.js.map +1 -1
  24. package/dist/packageVersion.d.ts +1 -1
  25. package/dist/packageVersion.d.ts.map +1 -1
  26. package/dist/packageVersion.js +1 -1
  27. package/dist/packageVersion.js.map +1 -1
  28. package/dist/retriableDocumentStorageService.d.ts +1 -1
  29. package/dist/retriableDocumentStorageService.d.ts.map +1 -1
  30. package/dist/retriableDocumentStorageService.js.map +1 -1
  31. package/lib/connectionStateHandler.d.ts +1 -0
  32. package/lib/connectionStateHandler.d.ts.map +1 -1
  33. package/lib/connectionStateHandler.js +11 -2
  34. package/lib/connectionStateHandler.js.map +1 -1
  35. package/lib/container.d.ts +3 -10
  36. package/lib/container.d.ts.map +1 -1
  37. package/lib/container.js +8 -21
  38. package/lib/container.js.map +1 -1
  39. package/lib/containerContext.d.ts +7 -3
  40. package/lib/containerContext.d.ts.map +1 -1
  41. package/lib/containerContext.js +5 -4
  42. package/lib/containerContext.js.map +1 -1
  43. package/lib/containerStorageAdapter.d.ts +1 -1
  44. package/lib/containerStorageAdapter.d.ts.map +1 -1
  45. package/lib/containerStorageAdapter.js.map +1 -1
  46. package/lib/deltaManager.d.ts +0 -11
  47. package/lib/deltaManager.d.ts.map +1 -1
  48. package/lib/deltaManager.js +0 -13
  49. package/lib/deltaManager.js.map +1 -1
  50. package/lib/deltaManagerProxy.d.ts +0 -1
  51. package/lib/deltaManagerProxy.d.ts.map +1 -1
  52. package/lib/deltaManagerProxy.js +0 -3
  53. package/lib/deltaManagerProxy.js.map +1 -1
  54. package/lib/packageVersion.d.ts +1 -1
  55. package/lib/packageVersion.d.ts.map +1 -1
  56. package/lib/packageVersion.js +1 -1
  57. package/lib/packageVersion.js.map +1 -1
  58. package/lib/retriableDocumentStorageService.d.ts +1 -1
  59. package/lib/retriableDocumentStorageService.d.ts.map +1 -1
  60. package/lib/retriableDocumentStorageService.js.map +1 -1
  61. package/package.json +9 -9
  62. package/src/connectionStateHandler.ts +13 -3
  63. package/src/container.ts +16 -28
  64. package/src/containerContext.ts +9 -8
  65. package/src/containerStorageAdapter.ts +1 -1
  66. package/src/deltaManager.ts +0 -14
  67. package/src/deltaManagerProxy.ts +0 -4
  68. package/src/packageVersion.ts +1 -1
  69. package/src/retriableDocumentStorageService.ts +1 -1
package/src/container.ts CHANGED
@@ -64,24 +64,24 @@ import {
64
64
  ICommittedProposal,
65
65
  IDocumentAttributes,
66
66
  IDocumentMessage,
67
+ IPendingProposal,
67
68
  IProcessMessageResult,
68
- IQuorum,
69
+ IQuorumClients,
70
+ IQuorumProposals,
69
71
  ISequencedClient,
70
72
  ISequencedDocumentMessage,
71
73
  ISequencedProposal,
72
74
  ISignalClient,
73
75
  ISignalMessage,
74
76
  ISnapshotTree,
77
+ ISummaryContent,
78
+ ISummaryTree,
75
79
  ITree,
76
80
  ITreeEntry,
77
81
  IVersion,
78
82
  MessageType,
79
- TreeEntry,
80
- ISummaryTree,
81
- IPendingProposal,
82
83
  SummaryType,
83
- ISummaryContent,
84
- IQuorumProposals,
84
+ TreeEntry,
85
85
  } from "@fluidframework/protocol-definitions";
86
86
  import {
87
87
  ChildLogger,
@@ -443,10 +443,6 @@ export class Container extends EventEmitterWithErrorHandling<IContainerEvents> i
443
443
  this._deltaManager.connectionManager.forceReadonly(readonly);
444
444
  }
445
445
 
446
- public get id(): string {
447
- return this._resolvedUrl?.id ?? "";
448
- }
449
-
450
446
  public get deltaManager(): IDeltaManager<ISequencedDocumentMessage, IDocumentMessage> {
451
447
  return this._deltaManager;
452
448
  }
@@ -487,16 +483,6 @@ export class Container extends EventEmitterWithErrorHandling<IContainerEvents> i
487
483
  return this._deltaManager.clientDetails;
488
484
  }
489
485
 
490
- /**
491
- * The current code details for the container's runtime
492
- * @deprecated use getSpecifiedCodeDetails for the code details currently specified for this container, or
493
- * getLoadedCodeDetails for the code details that the container's context was loaded with.
494
- * To be removed after getSpecifiedCodeDetails and getLoadedCodeDetails become ubiquitous.
495
- */
496
- public get codeDetails(): IFluidCodeDetails | undefined {
497
- return this._context?.codeDetails ?? this.getCodeDetailsFromQuorum();
498
- }
499
-
500
486
  /**
501
487
  * Get the code details that are currently specified for the container.
502
488
  * @returns The current code details if any are specified, undefined if none are specified.
@@ -570,7 +556,7 @@ export class Container extends EventEmitterWithErrorHandling<IContainerEvents> i
570
556
  all: {
571
557
  clientType, // Differentiating summarizer container from main container
572
558
  containerId: uuid(),
573
- docId: () => this.id,
559
+ docId: () => this._resolvedUrl?.id ?? undefined,
574
560
  containerAttachState: () => this._attachState,
575
561
  containerLifecycleState: () => this._lifecycleState,
576
562
  containerConnectionState: () => ConnectionState[this.connectionState],
@@ -629,6 +615,10 @@ export class Container extends EventEmitterWithErrorHandling<IContainerEvents> i
629
615
  this.mc.logger,
630
616
  );
631
617
 
618
+ this.on(savedContainerEvent, () => {
619
+ this.connectionStateHandler.containerSaved();
620
+ });
621
+
632
622
  this._deltaManager = this.createDeltaManager();
633
623
  this._storage = new ContainerStorageAdapter(
634
624
  () => {
@@ -702,7 +692,7 @@ export class Container extends EventEmitterWithErrorHandling<IContainerEvents> i
702
692
  /**
703
693
  * Retrieves the quorum associated with the document
704
694
  */
705
- public getQuorum(): IQuorum {
695
+ public getQuorum(): IQuorumClients {
706
696
  return this.protocolHandler.quorum;
707
697
  }
708
698
 
@@ -990,6 +980,7 @@ export class Container extends EventEmitterWithErrorHandling<IContainerEvents> i
990
980
  }
991
981
 
992
982
  /**
983
+ * @deprecated 0.56, will be removed in next release from IContainerContext
993
984
  * Raise non-critical error to host. Calling this API will not close container.
994
985
  * For critical errors, please call Container.close(error).
995
986
  * @param error - an error to raise
@@ -1065,7 +1056,7 @@ export class Container extends EventEmitterWithErrorHandling<IContainerEvents> i
1065
1056
  const message = `Commit @${deltaDetails} ${tagMessage}`;
1066
1057
 
1067
1058
  // Pull in the prior version and snapshot tree to store against
1068
- const lastVersion = await this.getVersion(this.id);
1059
+ const lastVersion = await this.getVersion(null);
1069
1060
 
1070
1061
  const parents = lastVersion !== undefined ? [lastVersion.id] : [];
1071
1062
 
@@ -1107,7 +1098,6 @@ export class Container extends EventEmitterWithErrorHandling<IContainerEvents> i
1107
1098
 
1108
1099
  // Save attributes for the document
1109
1100
  const documentAttributes = {
1110
- branch: this.id,
1111
1101
  minimumSequenceNumber: this._deltaManager.minimumSequenceNumber,
1112
1102
  sequenceNumber: this._deltaManager.lastSequenceNumber,
1113
1103
  term: this._deltaManager.referenceTerm,
@@ -1130,7 +1120,7 @@ export class Container extends EventEmitterWithErrorHandling<IContainerEvents> i
1130
1120
  return root;
1131
1121
  }
1132
1122
 
1133
- private async getVersion(version: string): Promise<IVersion | undefined> {
1123
+ private async getVersion(version: string | null): Promise<IVersion | undefined> {
1134
1124
  const versions = await this.storageService.getVersions(version, 1);
1135
1125
  return versions[0];
1136
1126
  }
@@ -1810,7 +1800,7 @@ export class Container extends EventEmitterWithErrorHandling<IContainerEvents> i
1810
1800
  private async fetchSnapshotTree(specifiedVersion: string | undefined):
1811
1801
  Promise<{snapshot?: ISnapshotTree; versionId?: string}>
1812
1802
  {
1813
- const version = await this.getVersion(specifiedVersion ?? this.id);
1803
+ const version = await this.getVersion(specifiedVersion ?? null);
1814
1804
 
1815
1805
  if (version === undefined && specifiedVersion !== undefined) {
1816
1806
  // We should have a defined version to load from if specified version requested
@@ -1883,8 +1873,6 @@ export class Container extends EventEmitterWithErrorHandling<IContainerEvents> i
1883
1873
  this.emit("contextChanged", codeDetails);
1884
1874
  }
1885
1875
 
1886
- // Please avoid calling it directly.
1887
- // raiseContainerWarning() is the right flow for most cases
1888
1876
  private logContainerError(warning: ContainerWarning) {
1889
1877
  this.mc.logger.sendErrorEvent({ eventName: "ContainerWarning" }, warning);
1890
1878
  }
@@ -34,13 +34,14 @@ import {
34
34
  IClientDetails,
35
35
  IDocumentMessage,
36
36
  IQuorum,
37
+ IQuorumClients,
37
38
  ISequencedDocumentMessage,
38
39
  ISignalMessage,
39
40
  ISnapshotTree,
40
- ITree,
41
- MessageType,
42
41
  ISummaryTree,
42
+ ITree,
43
43
  IVersion,
44
+ MessageType,
44
45
  } from "@fluidframework/protocol-definitions";
45
46
  import { PerformanceEvent } from "@fluidframework/telemetry-utils";
46
47
  import { assert, LazyPromise } from "@fluidframework/common-utils";
@@ -100,10 +101,6 @@ export class ContainerContext implements IContainerContext {
100
101
  return this.taggedLogger;
101
102
  }
102
103
 
103
- public get id(): string {
104
- return this.container.id;
105
- }
106
-
107
104
  public get clientId(): string | undefined {
108
105
  return this.container.clientId;
109
106
  }
@@ -167,8 +164,7 @@ export class ContainerContext implements IContainerContext {
167
164
  public get codeDetails() { return this._codeDetails; }
168
165
 
169
166
  private readonly _quorum: IQuorum;
170
- // Update to return IQuorumClients after 0.45 container definitions are picked up.
171
- public get quorum(): IQuorum { return this._quorum; }
167
+ public get quorum(): IQuorumClients { return this._quorum; }
172
168
 
173
169
  private readonly _fluidModuleP: Promise<IFluidModuleWithDetails>;
174
170
 
@@ -199,6 +195,11 @@ export class ContainerContext implements IContainerContext {
199
195
  this.attachListener();
200
196
  }
201
197
 
198
+ /**
199
+ * @deprecated - Temporary migratory API, to be removed when customers no longer need it. When removed,
200
+ * ContainerContext should only take an IQuorumClients rather than an IQuorum. See IContainerContext for more
201
+ * details.
202
+ */
202
203
  public getSpecifiedCodeDetails(): IFluidCodeDetails | undefined {
203
204
  return (this._quorum.get("code") ?? this._quorum.get("code2")) as IFluidCodeDetails | undefined;
204
205
  }
@@ -66,7 +66,7 @@ export class ContainerStorageAdapter implements IDocumentStorageService {
66
66
  return this.storageGetter().readBlob(id);
67
67
  }
68
68
 
69
- public async getVersions(versionId: string, count: number): Promise<IVersion[]> {
69
+ public async getVersions(versionId: string | null, count: number): Promise<IVersion[]> {
70
70
  return this.storageGetter().getVersions(versionId, count);
71
71
  }
72
72
 
@@ -182,20 +182,6 @@ export class DeltaManager<TConnectionManager extends IConnectionManager>
182
182
  public get readOnlyInfo() { return this.connectionManager.readOnlyInfo; }
183
183
  public get clientDetails() { return this.connectionManager.clientDetails; }
184
184
 
185
- /**
186
- * Tells if container is in read-only mode.
187
- * Data stores should listen for "readonly" notifications and disallow user
188
- * making changes to data stores.
189
- * Readonly state can be because of no storage write permission,
190
- * or due to host forcing readonly mode for container.
191
- * It is undefined if we have not yet established websocket connection
192
- * and do not know if user has write access to a file.
193
- * @deprecated - use readOnlyInfo
194
- */
195
- public get readonly() {
196
- return this.readOnlyInfo.readonly;
197
- }
198
-
199
185
  public submit(type: MessageType, contents: any, batch = false, metadata?: any) {
200
186
  // Start adding trace for the op.
201
187
  const traces: ITrace[] = [
@@ -129,10 +129,6 @@ export class DeltaManagerProxy
129
129
  return this.deltaManager.active;
130
130
  }
131
131
 
132
- public get readonly(): boolean | undefined {
133
- return this.deltaManager.readonly;
134
- }
135
-
136
132
  public get readOnlyInfo(): ReadOnlyInfo {
137
133
  return this.deltaManager.readOnlyInfo;
138
134
  }
@@ -6,4 +6,4 @@
6
6
  */
7
7
 
8
8
  export const pkgName = "@fluidframework/container-loader";
9
- export const pkgVersion = "0.55.1";
9
+ export const pkgVersion = "0.56.0-49831";
@@ -55,7 +55,7 @@ export class RetriableDocumentStorageService implements IDocumentStorageService,
55
55
  );
56
56
  }
57
57
 
58
- public async getVersions(versionId: string, count: number): Promise<IVersion[]> {
58
+ public async getVersions(versionId: string | null, count: number): Promise<IVersion[]> {
59
59
  return this.runWithRetry(
60
60
  async () => this.internalStorageService.getVersions(versionId, count),
61
61
  "storage_getVersions",