@fluidframework/container-loader 2.1.0-276985 → 2.1.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/CHANGELOG.md +4 -0
- package/README.md +132 -30
- package/api-extractor/api-extractor.current.json +5 -0
- package/api-extractor/api-extractor.legacy.json +1 -1
- package/api-extractor.json +1 -1
- package/api-report/container-loader.legacy.public.api.md +17 -0
- package/dist/connectionManager.d.ts.map +1 -1
- package/dist/connectionManager.js +9 -6
- package/dist/connectionManager.js.map +1 -1
- package/dist/container.d.ts.map +1 -1
- package/dist/container.js +28 -6
- package/dist/container.js.map +1 -1
- package/dist/containerStorageAdapter.d.ts +1 -1
- package/dist/containerStorageAdapter.d.ts.map +1 -1
- package/dist/containerStorageAdapter.js +14 -4
- package/dist/containerStorageAdapter.js.map +1 -1
- package/dist/contracts.d.ts.map +1 -1
- package/dist/contracts.js +4 -12
- package/dist/contracts.js.map +1 -1
- package/dist/deltaManager.d.ts.map +1 -1
- package/dist/deltaManager.js +18 -3
- package/dist/deltaManager.js.map +1 -1
- package/dist/legacy.d.ts +1 -1
- package/dist/packageVersion.d.ts +1 -1
- package/dist/packageVersion.d.ts.map +1 -1
- package/dist/packageVersion.js +1 -1
- package/dist/packageVersion.js.map +1 -1
- package/dist/public.d.ts +1 -1
- package/dist/serializedStateManager.d.ts.map +1 -1
- package/dist/serializedStateManager.js +18 -5
- package/dist/serializedStateManager.js.map +1 -1
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +11 -2
- package/dist/utils.js.map +1 -1
- package/internal.d.ts +1 -1
- package/legacy.d.ts +1 -1
- package/lib/connectionManager.d.ts.map +1 -1
- package/lib/connectionManager.js +9 -6
- package/lib/connectionManager.js.map +1 -1
- package/lib/container.d.ts.map +1 -1
- package/lib/container.js +28 -6
- package/lib/container.js.map +1 -1
- package/lib/containerStorageAdapter.d.ts +1 -1
- package/lib/containerStorageAdapter.d.ts.map +1 -1
- package/lib/containerStorageAdapter.js +16 -6
- package/lib/containerStorageAdapter.js.map +1 -1
- package/lib/contracts.d.ts.map +1 -1
- package/lib/contracts.js +4 -12
- package/lib/contracts.js.map +1 -1
- package/lib/deltaManager.d.ts.map +1 -1
- package/lib/deltaManager.js +18 -3
- package/lib/deltaManager.js.map +1 -1
- package/lib/legacy.d.ts +1 -1
- package/lib/packageVersion.d.ts +1 -1
- package/lib/packageVersion.d.ts.map +1 -1
- package/lib/packageVersion.js +1 -1
- package/lib/packageVersion.js.map +1 -1
- package/lib/public.d.ts +1 -1
- package/lib/serializedStateManager.d.ts.map +1 -1
- package/lib/serializedStateManager.js +18 -5
- package/lib/serializedStateManager.js.map +1 -1
- package/lib/utils.d.ts.map +1 -1
- package/lib/utils.js +11 -2
- package/lib/utils.js.map +1 -1
- package/package.json +25 -23
- package/src/connectionManager.ts +13 -12
- package/src/container.ts +31 -8
- package/src/containerStorageAdapter.ts +22 -7
- package/src/contracts.ts +5 -11
- package/src/deltaManager.ts +18 -6
- package/src/packageVersion.ts +1 -1
- package/src/serializedStateManager.ts +20 -12
- package/src/utils.ts +15 -6
- package/tsconfig.json +0 -1
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
|
@@ -1,6 +1,47 @@
|
|
|
1
1
|
# @fluidframework/container-loader
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
|
|
4
|
+
**Topics covered below:**
|
|
5
|
+
|
|
6
|
+
- [@fluidframework/container-loader](#fluidframeworkcontainer-loader)
|
|
7
|
+
- [Using Fluid Framework libraries](#using-fluid-framework-libraries)
|
|
8
|
+
- [Installation](#installation)
|
|
9
|
+
- [Importing from this package](#importing-from-this-package)
|
|
10
|
+
- [Fluid Loader](#fluid-loader)
|
|
11
|
+
- [Expectations from host implementers](#expectations-from-host-implementers)
|
|
12
|
+
- [Expectations from container runtime and data store implementers](#expectations-from-container-runtime-and-data-store-implementers)
|
|
13
|
+
- [Container Lifetime](#container-lifetime)
|
|
14
|
+
- [Loading](#loading)
|
|
15
|
+
- [Connectivity](#connectivity)
|
|
16
|
+
- [Closure](#closure)
|
|
17
|
+
- [`Container.close()`](#containerclose)
|
|
18
|
+
- [`Container.dispose()`](#containerdispose)
|
|
19
|
+
- [Audience](#audience)
|
|
20
|
+
- [ClientID and client identification](#clientid-and-client-identification)
|
|
21
|
+
- [Error handling](#error-handling)
|
|
22
|
+
- [Connectivity events](#connectivity-events)
|
|
23
|
+
- [Connection State Transitions Flow Chart](#connection-state-transitions-flow-chart)
|
|
24
|
+
- [Readonly states](#readonly-states)
|
|
25
|
+
- [`readonly`](#readonly)
|
|
26
|
+
- [`permissions`](#permissions)
|
|
27
|
+
- [`forced`](#forced)
|
|
28
|
+
- [`storageOnly`](#storageonly)
|
|
29
|
+
- [Dirty events](#dirty-events)
|
|
30
|
+
- [API Documentation](#api-documentation)
|
|
31
|
+
- [Minimum Client Requirements](#minimum-client-requirements)
|
|
32
|
+
- [Supported Runtimes](#supported-runtimes)
|
|
33
|
+
- [Supported Tools](#supported-tools)
|
|
34
|
+
- [Module Resolution](#module-resolution)
|
|
35
|
+
- [Module Formats](#module-formats)
|
|
36
|
+
- [Contribution Guidelines](#contribution-guidelines)
|
|
37
|
+
- [Help](#help)
|
|
38
|
+
- [Trademark](#trademark)
|
|
39
|
+
|
|
40
|
+
**Related topics covered elsewhere:**
|
|
41
|
+
|
|
42
|
+
- [Quorum and Proposals](../../../server/routerlicious/packages/protocol-base/README.md)
|
|
43
|
+
|
|
44
|
+
<!-- AUTO-GENERATED-CONTENT:START (LIBRARY_PACKAGE_README_HEADER) -->
|
|
4
45
|
|
|
5
46
|
<!-- prettier-ignore-start -->
|
|
6
47
|
<!-- NOTE: This section is automatically generated using @fluid-tools/markdown-magic. Do not update these generated contents directly. -->
|
|
@@ -13,39 +54,30 @@ library consumers should always prefer `^`.
|
|
|
13
54
|
|
|
14
55
|
If using any of Fluid Framework's unstable APIs (for example, its `beta` APIs), we recommend using a more constrained version range, such as `~`.
|
|
15
56
|
|
|
16
|
-
|
|
57
|
+
## Installation
|
|
17
58
|
|
|
18
|
-
|
|
59
|
+
To get started, install the package by running the following command:
|
|
19
60
|
|
|
20
|
-
|
|
61
|
+
```bash
|
|
62
|
+
npm i @fluidframework/container-loader
|
|
63
|
+
```
|
|
21
64
|
|
|
22
|
-
|
|
23
|
-
- [Using Fluid Framework libraries](#using-fluid-framework-libraries)
|
|
24
|
-
- [Fluid Loader](#fluid-loader)
|
|
25
|
-
- [Expectations from host implementers](#expectations-from-host-implementers)
|
|
26
|
-
- [Expectations from container runtime and data store implementers](#expectations-from-container-runtime-and-data-store-implementers)
|
|
27
|
-
- [Container Lifetime](#container-lifetime)
|
|
28
|
-
- [Loading](#loading)
|
|
29
|
-
- [Connectivity](#connectivity)
|
|
30
|
-
- [Closure](#closure)
|
|
31
|
-
- [`Container.close()`](#containerclose)
|
|
32
|
-
- [`Container.dispose()`](#containerdispose)
|
|
33
|
-
- [Audience](#audience)
|
|
34
|
-
- [ClientID and client identification](#clientid-and-client-identification)
|
|
35
|
-
- [Error handling](#error-handling)
|
|
36
|
-
- [Connectivity events](#connectivity-events)
|
|
37
|
-
- [Connection State Transitions Flow Chart](#connection-state-transitions-flow-chart)
|
|
38
|
-
- [Readonly states](#readonly-states)
|
|
39
|
-
- [`readonly`](#readonly)
|
|
40
|
-
- [`permissions`](#permissions)
|
|
41
|
-
- [`forced`](#forced)
|
|
42
|
-
- [`storageOnly`](#storageonly)
|
|
43
|
-
- [Dirty events](#dirty-events)
|
|
44
|
-
- [Trademark](#trademark)
|
|
65
|
+
## Importing from this package
|
|
45
66
|
|
|
46
|
-
|
|
67
|
+
This package leverages [package.json exports](https://nodejs.org/api/packages.html#exports) to separate its APIs by support level.
|
|
68
|
+
For more information on the related support guarantees, see [API Support Levels](https://fluidframework.com/docs/build/releases-and-apitags/#api-support-levels).
|
|
47
69
|
|
|
48
|
-
|
|
70
|
+
To access the `public` ([SemVer](https://semver.org/)) APIs, import via `@fluidframework/container-loader` like normal.
|
|
71
|
+
|
|
72
|
+
To access the `legacy` APIs, import via `@fluidframework/container-loader/legacy`.
|
|
73
|
+
|
|
74
|
+
## API Documentation
|
|
75
|
+
|
|
76
|
+
API documentation for **@fluidframework/container-loader** is available at <https://fluidframework.com/docs/apis/container-loader>.
|
|
77
|
+
|
|
78
|
+
<!-- prettier-ignore-end -->
|
|
79
|
+
|
|
80
|
+
<!-- AUTO-GENERATED-CONTENT:END -->
|
|
49
81
|
|
|
50
82
|
## Fluid Loader
|
|
51
83
|
|
|
@@ -264,11 +296,81 @@ Note that when an active connection is in place, it's just a matter of time befo
|
|
|
264
296
|
|
|
265
297
|
`Container.isDirty` can be used to get current state of container.
|
|
266
298
|
|
|
267
|
-
<!-- AUTO-GENERATED-CONTENT:START (
|
|
299
|
+
<!-- AUTO-GENERATED-CONTENT:START (LIBRARY_PACKAGE_README_FOOTER) -->
|
|
268
300
|
|
|
269
301
|
<!-- prettier-ignore-start -->
|
|
270
302
|
<!-- NOTE: This section is automatically generated using @fluid-tools/markdown-magic. Do not update these generated contents directly. -->
|
|
271
303
|
|
|
304
|
+
## Minimum Client Requirements
|
|
305
|
+
|
|
306
|
+
These are the platform requirements for the current version of Fluid Framework Client Packages.
|
|
307
|
+
These requirements err on the side of being too strict since within a major version they can be relaxed over time, but not made stricter.
|
|
308
|
+
For Long Term Support (LTS) versions this can require supporting these platforms for several years.
|
|
309
|
+
|
|
310
|
+
It is likely that other configurations will work, but they are not supported: if they stop working, we do not consider that a bug.
|
|
311
|
+
If you would benefit from support for something not listed here, file an issue and the product team will evaluate your request.
|
|
312
|
+
When making such a request please include if the configuration already works (and thus the request is just that it becomes officially supported), or if changes are required to get it working.
|
|
313
|
+
|
|
314
|
+
### Supported Runtimes
|
|
315
|
+
|
|
316
|
+
- NodeJs ^20.10.0 except that we will drop support for it [when NodeJs 20 loses its upstream support on 2026-04-30](https://github.com/nodejs/release#release-schedule), and will support a newer LTS version of NodeJS (22) at least 1 year before 20 is end-of-life. This same policy applies to NodeJS 22 when it is end of life (2027-04-30).
|
|
317
|
+
- Modern browsers supporting the es2022 standard library: in response to asks we can add explicit support for using babel to polyfill to target specific standards or runtimes (meaning we can avoid/remove use of things that don't polyfill robustly, but otherwise target modern standards).
|
|
318
|
+
|
|
319
|
+
### Supported Tools
|
|
320
|
+
|
|
321
|
+
- TypeScript 5.4:
|
|
322
|
+
- All [`strict`](https://www.typescriptlang.org/tsconfig) options are supported.
|
|
323
|
+
- [`strictNullChecks`](https://www.typescriptlang.org/tsconfig) is required.
|
|
324
|
+
- [Configuration options deprecated in 5.0](https://github.com/microsoft/TypeScript/issues/51909) are not supported.
|
|
325
|
+
- `exactOptionalPropertyTypes` is currently not fully supported.
|
|
326
|
+
If used, narrowing members of Fluid Framework types types using `in`, `Reflect.has`, `Object.hasOwn` or `Object.prototype.hasOwnProperty` should be avoided as they may incorrectly exclude `undefined` from the possible values in some cases.
|
|
327
|
+
- [webpack](https://webpack.js.org/) 5
|
|
328
|
+
- We are not intending to be prescriptive about what bundler to use.
|
|
329
|
+
Other bundlers which can handle ES Modules should work, but webpack is the only one we actively test.
|
|
330
|
+
|
|
331
|
+
### Module Resolution
|
|
332
|
+
|
|
333
|
+
[`Node16`, `NodeNext`, or `Bundler`](https://www.typescriptlang.org/tsconfig#moduleResolution) resolution should be used with TypeScript compilerOptions to follow the [Node.js v12+ ESM Resolution and Loading algorithm](https://nodejs.github.io/nodejs.dev/en/api/v20/esm/#resolution-and-loading-algorithm).
|
|
334
|
+
Node10 resolution is not supported as it does not support Fluid Framework's API structuring pattern that is used to distinguish stable APIs from those that are in development.
|
|
335
|
+
|
|
336
|
+
### Module Formats
|
|
337
|
+
|
|
338
|
+
- ES Modules:
|
|
339
|
+
ES Modules are the preferred way to consume our client packages (including in NodeJs) and consuming our client packages from ES Modules is fully supported.
|
|
340
|
+
- CommonJs:
|
|
341
|
+
Consuming our client packages as CommonJs is supported only in NodeJS and only for the cases listed below.
|
|
342
|
+
This is done to accommodate some workflows without good ES Module support.
|
|
343
|
+
If you have a workflow you would like included in this list, file an issue.
|
|
344
|
+
Once this list of workflows motivating CommonJS support is empty, we may drop support for CommonJS one year after notice of the change is posted here.
|
|
345
|
+
|
|
346
|
+
- Testing with Jest (which lacks [stable ESM support](https://jestjs.io/docs/ecmascript-modules) due to [unstable APIs in NodeJs](https://github.com/nodejs/node/issues/37648))
|
|
347
|
+
|
|
348
|
+
## Contribution Guidelines
|
|
349
|
+
|
|
350
|
+
There are many ways to [contribute](https://github.com/microsoft/FluidFramework/blob/main/CONTRIBUTING.md) to Fluid.
|
|
351
|
+
|
|
352
|
+
- Participate in Q&A in our [GitHub Discussions](https://github.com/microsoft/FluidFramework/discussions).
|
|
353
|
+
- [Submit bugs](https://github.com/microsoft/FluidFramework/issues) and help us verify fixes as they are checked in.
|
|
354
|
+
- Review the [source code changes](https://github.com/microsoft/FluidFramework/pulls).
|
|
355
|
+
- [Contribute bug fixes](https://github.com/microsoft/FluidFramework/blob/main/CONTRIBUTING.md).
|
|
356
|
+
|
|
357
|
+
Detailed instructions for working in the repo can be found in the [Wiki](https://github.com/microsoft/FluidFramework/wiki).
|
|
358
|
+
|
|
359
|
+
This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).
|
|
360
|
+
For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.
|
|
361
|
+
|
|
362
|
+
This project may contain Microsoft trademarks or logos for Microsoft projects, products, or services.
|
|
363
|
+
Use of these trademarks or logos must follow Microsoft’s [Trademark & Brand Guidelines](https://www.microsoft.com/trademarks).
|
|
364
|
+
Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship.
|
|
365
|
+
|
|
366
|
+
## Help
|
|
367
|
+
|
|
368
|
+
Not finding what you're looking for in this README? Check out [fluidframework.com](https://fluidframework.com/docs/).
|
|
369
|
+
|
|
370
|
+
Still not finding what you're looking for? Please [file an issue](https://github.com/microsoft/FluidFramework/wiki/Submitting-Bugs-and-Feature-Requests).
|
|
371
|
+
|
|
372
|
+
Thank you!
|
|
373
|
+
|
|
272
374
|
## Trademark
|
|
273
375
|
|
|
274
376
|
This project may contain Microsoft trademarks or logos for Microsoft projects, products, or services.
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
|
|
3
|
+
"extends": "<projectFolder>/../../../common/build/build-common/api-extractor-report.esm.current.json",
|
|
4
|
+
"mainEntryPointFilePath": "<projectFolder>/lib/public.d.ts"
|
|
5
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
|
|
3
|
-
"extends": "<projectFolder>/../../../common/build/build-common/api-extractor-
|
|
3
|
+
"extends": "<projectFolder>/../../../common/build/build-common/api-extractor-report.esm.legacy.json"
|
|
4
4
|
}
|
package/api-extractor.json
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
|
|
3
|
-
"extends": "../../../common/build/build-common/api-extractor-
|
|
3
|
+
"extends": "../../../common/build/build-common/api-extractor-model.esm.json"
|
|
4
4
|
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
## Public API Report File for "@fluidframework/container-loader"
|
|
2
|
+
|
|
3
|
+
> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
|
|
4
|
+
|
|
5
|
+
```ts
|
|
6
|
+
|
|
7
|
+
// @public
|
|
8
|
+
export enum ConnectionState {
|
|
9
|
+
CatchingUp = 1,
|
|
10
|
+
Connected = 2,
|
|
11
|
+
Disconnected = 0,
|
|
12
|
+
EstablishingConnection = 3
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
// (No @packageDocumentation comment for this package)
|
|
16
|
+
|
|
17
|
+
```
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"connectionManager.d.ts","sourceRoot":"","sources":["../src/connectionManager.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,uBAAuB,EAAE,MAAM,uCAAuC,CAAC;AAChF,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,gDAAgD,CAAC;AAC3F,OAAO,EAEN,wBAAwB,EAExB,MAAM,iCAAiC,CAAC;AAEzC,OAAO,EAAE,cAAc,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AAC7F,OAAO,EAGN,gBAAgB,EAGhB,oBAAoB,EACpB,gBAAgB,EAQhB,yBAAyB,EAEzB,MAAM,6CAA6C,CAAC;AAYrD,OAAO,EACN,mBAAmB,EAOnB,MAAM,0CAA0C,CAAC;AAElD,OAAO,EACN,0BAA0B,EAC1B,kBAAkB,EAClB,6BAA6B,EAC7B,4BAA4B,EAC5B,aAAa,EACb,MAAM,gBAAgB,CAAC;AAoIxB;;;;GAIG;AACH,qBAAa,iBAAkB,YAAW,kBAAkB;IA6M1D,OAAO,CAAC,QAAQ,CAAC,eAAe;aAChB,cAAc,EAAE,MAAM,OAAO;IAC7C,OAAO,CAAC,QAAQ,CAAC,MAAM;IAEvB,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,KAAK;IAjNvB;;OAEG;IACH,OAAO,CAAC,QAAQ,CAAC,uBAAuB,CAAiB;IAEzD;;;;OAIG;IACH,OAAO,CAAC,iBAAiB,CAAiC;IAC1D,OAAO,CAAC,UAAU,CAAuC;IAEzD;;OAEG;IACH,OAAO,CAAC,kBAAkB,CAAC,CAA6B;IAExD;;OAEG;IACH,OAAO,CAAC,oBAAoB,CAAsB;IAElD;;OAEG;IACH,OAAO,CAAC,cAAc,CAAS;IAE/B;;OAEG;IACH,OAAO,CAAC,cAAc,CAAgB;IAE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CAAC,gBAAgB;IAiBxB;;;;OAIG;IACH,OAAO,CAAC,4BAA4B;IA2JpC;;;;;;OAMG;IACH,OAAO,CAAC,gBAAgB;IAMxB;;;;;;OAMG;YACW,SAAS;IA8DhB,oBAAoB,CAC1B,OAAO,EAAE,IAAI,CAAC,gBAAgB,EAAE,sBAAsB,CAAC,GACrD,gBAAgB,GAAG,SAAS;IAuCxB,YAAY,CAAC,OAAO,EAAE,MAAM,EAAE,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI;IAQ5D,YAAY,CAAC,QAAQ,EAAE,gBAAgB,EAAE,GAAG,IAAI;IA+BhD,0BAA0B,CAAC,OAAO,EAAE,yBAAyB,GAAG,IAAI;IAgD3E,OAAO,CAAC,QAAQ,CAAC,SAAS,CAMxB;IAEF,OAAO,CAAC,QAAQ,CAAC,aAAa,CAG5B;IAGF,OAAO,CAAC,QAAQ,CAAC,WAAW,CAoB1B;IAGF,OAAO,CAAC,QAAQ,CAAC,yBAAyB,CAIxC;IAEF,OAAO,CAAC,QAAQ,CAAC,YAAY,CAE3B;CACF"}
|
|
@@ -263,6 +263,8 @@ class ConnectionManager {
|
|
|
263
263
|
};
|
|
264
264
|
// Always connect in write mode after getting nacked.
|
|
265
265
|
this.nackHandler = (documentId, messages) => {
|
|
266
|
+
// TODO Why are we non null asserting here?
|
|
267
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
266
268
|
const message = messages[0];
|
|
267
269
|
if (this._readonlyPermissions === true) {
|
|
268
270
|
this.props.closeHandler((0, internal_3.createWriteError)("writeOnReadOnlyDocument", { driverVersion: undefined }));
|
|
@@ -644,7 +646,7 @@ class ConnectionManager {
|
|
|
644
646
|
// Does information in scopes & mode matches?
|
|
645
647
|
// If we asked for "write" and got "read", then file is read-only
|
|
646
648
|
// But if we ask read, server can still give us write.
|
|
647
|
-
const
|
|
649
|
+
const readonlyPermission = !connection.claims.scopes.includes(internal_2.ScopeType.DocWrite);
|
|
648
650
|
if (connection.mode !== requestedMode) {
|
|
649
651
|
this.logger.sendTelemetryEvent({
|
|
650
652
|
eventName: "ConnectionModeMismatch",
|
|
@@ -652,11 +654,8 @@ class ConnectionManager {
|
|
|
652
654
|
mode: connection.mode,
|
|
653
655
|
});
|
|
654
656
|
}
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
(0, internal_1.assert)(requestedMode === "read" || readonly === (this.connectionMode === "read"), 0x0e7 /* "claims/connectionMode mismatch" */);
|
|
658
|
-
(0, internal_1.assert)(!readonly || this.connectionMode === "read", 0x0e8 /* "readonly perf with write connection" */);
|
|
659
|
-
this.set_readonlyPermissions(readonly, oldReadonlyValue, isNoDeltaStreamConnection(connection) ? connection.readonlyConnectionReason : undefined);
|
|
657
|
+
(0, internal_1.assert)(!readonlyPermission || this.connectionMode === "read", 0x0e8 /* "readonly perf with write connection" */);
|
|
658
|
+
this.set_readonlyPermissions(readonlyPermission, oldReadonlyValue, isNoDeltaStreamConnection(connection) ? connection.readonlyConnectionReason : undefined);
|
|
660
659
|
if (this._disposed) {
|
|
661
660
|
// Raise proper events, Log telemetry event and close connection.
|
|
662
661
|
this.disconnectFromDeltaStream({ text: "ConnectionManager already closed" });
|
|
@@ -691,7 +690,11 @@ class ConnectionManager {
|
|
|
691
690
|
let last = -1;
|
|
692
691
|
if (initialMessages.length > 0) {
|
|
693
692
|
this._connectionVerboseProps.connectionInitialOpsFrom =
|
|
693
|
+
// Non null asserting here because of the length check above
|
|
694
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
694
695
|
initialMessages[0].sequenceNumber;
|
|
696
|
+
// Non null asserting here because of the length check above
|
|
697
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
695
698
|
last = initialMessages[initialMessages.length - 1].sequenceNumber;
|
|
696
699
|
this._connectionVerboseProps.connectionInitialOpsTo = last + 1;
|
|
697
700
|
// Update knowledge of how far we are behind, before raising "connect" event
|