@fluidframework/container-loader 2.1.0 → 2.2.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluidframework/container-loader",
3
- "version": "2.1.0",
3
+ "version": "2.2.0",
4
4
  "description": "Fluid container loader",
5
5
  "homepage": "https://fluidframework.com",
6
6
  "repository": {
@@ -117,13 +117,13 @@
117
117
  "temp-directory": "nyc/.nyc_output"
118
118
  },
119
119
  "dependencies": {
120
- "@fluid-internal/client-utils": "~2.1.0",
121
- "@fluidframework/container-definitions": "~2.1.0",
122
- "@fluidframework/core-interfaces": "~2.1.0",
123
- "@fluidframework/core-utils": "~2.1.0",
124
- "@fluidframework/driver-definitions": "~2.1.0",
125
- "@fluidframework/driver-utils": "~2.1.0",
126
- "@fluidframework/telemetry-utils": "~2.1.0",
120
+ "@fluid-internal/client-utils": "~2.2.0",
121
+ "@fluidframework/container-definitions": "~2.2.0",
122
+ "@fluidframework/core-interfaces": "~2.2.0",
123
+ "@fluidframework/core-utils": "~2.2.0",
124
+ "@fluidframework/driver-definitions": "~2.2.0",
125
+ "@fluidframework/driver-utils": "~2.2.0",
126
+ "@fluidframework/telemetry-utils": "~2.2.0",
127
127
  "@types/events_pkg": "npm:@types/events@^3.0.0",
128
128
  "@ungap/structured-clone": "^1.2.0",
129
129
  "debug": "^4.3.4",
@@ -134,13 +134,13 @@
134
134
  "devDependencies": {
135
135
  "@arethetypeswrong/cli": "^0.15.2",
136
136
  "@biomejs/biome": "~1.8.3",
137
- "@fluid-internal/client-utils": "~2.1.0",
138
- "@fluid-internal/mocha-test-setup": "~2.1.0",
139
- "@fluid-private/test-loader-utils": "~2.1.0",
140
- "@fluid-tools/build-cli": "^0.41.0",
137
+ "@fluid-internal/client-utils": "~2.2.0",
138
+ "@fluid-internal/mocha-test-setup": "~2.2.0",
139
+ "@fluid-private/test-loader-utils": "~2.2.0",
140
+ "@fluid-tools/build-cli": "^0.43.0",
141
141
  "@fluidframework/build-common": "^2.0.3",
142
- "@fluidframework/build-tools": "^0.41.0",
143
- "@fluidframework/container-loader-previous": "npm:@fluidframework/container-loader@2.0.0",
142
+ "@fluidframework/build-tools": "^0.43.0",
143
+ "@fluidframework/container-loader-previous": "npm:@fluidframework/container-loader@2.1.0",
144
144
  "@fluidframework/eslint-config-fluid": "^5.3.0",
145
145
  "@microsoft/api-extractor": "^7.45.1",
146
146
  "@types/debug": "^4.1.5",
package/src/container.ts CHANGED
@@ -221,6 +221,7 @@ export interface IContainerCreateProps {
221
221
  * A property bag of options used by various layers
222
222
  * to control features
223
223
  */
224
+ // eslint-disable-next-line import/no-deprecated
224
225
  readonly options: ILoaderOptions;
225
226
 
226
227
  /**
@@ -482,6 +483,7 @@ export class Container
482
483
  private readonly urlResolver: IUrlResolver;
483
484
  private readonly serviceFactory: IDocumentServiceFactory;
484
485
  private readonly codeLoader: ICodeDetailsLoader;
486
+ // eslint-disable-next-line import/no-deprecated
485
487
  private readonly options: ILoaderOptions;
486
488
  private readonly scope: FluidObject;
487
489
  private readonly subLogger: ITelemetryLoggerExt;
@@ -2133,14 +2135,14 @@ export class Container
2133
2135
  lastProcessedSequenceNumber?: number,
2134
2136
  ): Promise<void> {
2135
2137
  return this._deltaManager.attachOpHandler(
2136
- attributes.minimumSequenceNumber,
2137
- attributes.sequenceNumber,
2138
+ attributes.minimumSequenceNumber /* minimumSequenceNumber */,
2139
+ attributes.sequenceNumber /* snapshotSequenceNumber */,
2138
2140
  {
2139
2141
  process: (message) => this.processRemoteMessage(message),
2140
2142
  processSignal: (message) => {
2141
2143
  this.processSignal(message);
2142
2144
  },
2143
- },
2145
+ } /* handler to process incoming delta messages */,
2144
2146
  prefetchType,
2145
2147
  lastProcessedSequenceNumber,
2146
2148
  );
@@ -2333,6 +2335,10 @@ export class Container
2333
2335
  );
2334
2336
  }
2335
2337
 
2338
+ /**
2339
+ * Processes incoming delta messages
2340
+ * @param message - delta message received from the server
2341
+ */
2336
2342
  private processRemoteMessage(message: ISequencedDocumentMessage): void {
2337
2343
  const local = this.clientId === message.clientId;
2338
2344
 
@@ -1076,11 +1076,20 @@ export class DeltaManager<TConnectionManager extends IConnectionManager>
1076
1076
 
1077
1077
  // Watch the minimum sequence number and be ready to update as needed
1078
1078
  if (this.minSequenceNumber > message.minimumSequenceNumber) {
1079
- // pre-0.58 error message: msnMovesBackwards
1080
- throw new DataCorruptionError(
1081
- "Found a lower minimumSequenceNumber (msn) than previously recorded",
1079
+ // This indicates that an invalid series of ops was received by this client.
1080
+ // In the unlikely case where these ops have been truly sequenced and persisted to storage,
1081
+ // this document is corrupted - It will fail here on boot every time.
1082
+ // The more likely scenario, based on the realities of production service operation, is that
1083
+ // something has changed out from under the file on the server, such that the service lost some ops
1084
+ // which this client already processed - the very ops that made this _next_ op to appear invalid.
1085
+ // In this case, only this client will fail (and lose this recent data), but others will be able to connect and continue.
1086
+ throw DataProcessingError.create(
1087
+ // error message through v0.57: msnMovesBackwards
1088
+ // error message through v2.1: "Found a lower minimumSequenceNumber (msn) than previously recorded",
1089
+ "Invalid MinimumSequenceNumber from service - document may have been restored to previous state",
1090
+ "DeltaManager.processInboundMessage",
1091
+ message,
1082
1092
  {
1083
- ...extractSafePropertiesFromMessage(message),
1084
1093
  clientId: this.connectionManager.clientId,
1085
1094
  },
1086
1095
  );
package/src/loader.ts CHANGED
@@ -93,8 +93,15 @@ export class RelativeLoader implements ILoader {
93
93
  /**
94
94
  * @legacy
95
95
  * @alpha
96
+ * @deprecated Use {@link @fluidframework/container-definitions#ILoaderOptions} instead
96
97
  */
97
98
  export interface ILoaderOptions extends ILoaderOptions1 {
99
+ /**
100
+ *
101
+ * @deprecated No longer needed or used (initially introduced to test single-commit summaries).
102
+ * Driver layer can enable single-commit summaries via document service policies if needed.
103
+ * ADO #9098: To remove declaration and usage from code.
104
+ */
98
105
  summarizeProtocolTree?: boolean;
99
106
  }
100
107
 
@@ -6,4 +6,4 @@
6
6
  */
7
7
 
8
8
  export const pkgName = "@fluidframework/container-loader";
9
- export const pkgVersion = "2.1.0";
9
+ export const pkgVersion = "2.2.0";