@fluidframework/container-runtime 2.74.0-368706 → 2.74.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.
Files changed (36) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/container-runtime.test-files.tar +0 -0
  3. package/dist/channelCollection.d.ts.map +1 -1
  4. package/dist/channelCollection.js +20 -2
  5. package/dist/channelCollection.js.map +1 -1
  6. package/dist/dataStoreContexts.d.ts +56 -9
  7. package/dist/dataStoreContexts.d.ts.map +1 -1
  8. package/dist/dataStoreContexts.js +56 -9
  9. package/dist/dataStoreContexts.js.map +1 -1
  10. package/dist/packageVersion.d.ts +1 -1
  11. package/dist/packageVersion.d.ts.map +1 -1
  12. package/dist/packageVersion.js +1 -1
  13. package/dist/packageVersion.js.map +1 -1
  14. package/dist/runtimeLayerCompatState.d.ts +2 -2
  15. package/dist/runtimeLayerCompatState.js +1 -1
  16. package/dist/runtimeLayerCompatState.js.map +1 -1
  17. package/eslint.config.mts +31 -0
  18. package/lib/channelCollection.d.ts.map +1 -1
  19. package/lib/channelCollection.js +20 -2
  20. package/lib/channelCollection.js.map +1 -1
  21. package/lib/dataStoreContexts.d.ts +56 -9
  22. package/lib/dataStoreContexts.d.ts.map +1 -1
  23. package/lib/dataStoreContexts.js +56 -9
  24. package/lib/dataStoreContexts.js.map +1 -1
  25. package/lib/packageVersion.d.ts +1 -1
  26. package/lib/packageVersion.d.ts.map +1 -1
  27. package/lib/packageVersion.js +1 -1
  28. package/lib/packageVersion.js.map +1 -1
  29. package/lib/runtimeLayerCompatState.d.ts +2 -2
  30. package/lib/runtimeLayerCompatState.js +1 -1
  31. package/lib/runtimeLayerCompatState.js.map +1 -1
  32. package/package.json +21 -20
  33. package/src/channelCollection.ts +26 -2
  34. package/src/dataStoreContexts.ts +56 -9
  35. package/src/packageVersion.ts +1 -1
  36. package/src/runtimeLayerCompatState.ts +1 -1
@@ -5,22 +5,36 @@
5
5
  import type { IDisposable, ITelemetryBaseLogger } from "@fluidframework/core-interfaces";
6
6
  import type { FluidDataStoreContext, LocalFluidDataStoreContext } from "./dataStoreContext.js";
7
7
  /**
8
+ * Manages the collection of data store contexts, tracking their bound/unbound state.
9
+ *
10
+ * @remarks
11
+ * A context is "unbound" when it's created locally but not yet made visible (reachable from root).
12
+ * A context is "bound" once it's made locally visible, regardless of the Container's attach state.
13
+ * In attached containers, binding a context immediately sends an attach op and transitions it to Attaching state.
14
+ *
8
15
  * @internal
9
16
  */
10
17
  export declare class DataStoreContexts implements Iterable<[string, FluidDataStoreContext]>, IDisposable {
18
+ /**
19
+ * Set of IDs for contexts that are unbound (not yet made locally visible).
20
+ * These contexts exist locally but aren't known to other clients (even in an attached container).
21
+ */
11
22
  private readonly notBoundContexts;
12
23
  /**
13
- * Attached and loaded context proxies
24
+ * Map of all data store contexts (both bound and unbound).
14
25
  */
15
26
  private readonly _contexts;
16
27
  /**
17
28
  * List of pending context waiting either to be bound or to arrive from another client.
18
29
  * This covers the case where a local context has been created but not yet bound,
19
- * or the case where a client knows a store will exist and is waiting on its creation,
30
+ * or the case where a client knows a store will exist (e.g. by alias) and is waiting on its creation,
20
31
  * so that a caller may await the deferred's promise until such a time as the context is fully ready.
21
32
  * This is a superset of _contexts, since contexts remain here once the Deferred resolves.
22
33
  */
23
34
  private readonly deferredContexts;
35
+ /**
36
+ * Lazy disposal logic that disposes all contexts when called.
37
+ */
24
38
  private readonly disposeOnce;
25
39
  private readonly _logger;
26
40
  constructor(baseLogger: ITelemetryBaseLogger);
@@ -28,20 +42,46 @@ export declare class DataStoreContexts implements Iterable<[string, FluidDataSto
28
42
  get size(): number;
29
43
  get disposed(): boolean;
30
44
  readonly dispose: () => void;
45
+ /**
46
+ * Returns the count of unbound contexts (i.e. local-only on this client)
47
+ */
31
48
  notBoundLength(): number;
49
+ /**
50
+ * Returns true if the given ID corresponds to an unbound context. (i.e. local-only on this client)
51
+ */
32
52
  isNotBound(id: string): boolean;
53
+ /**
54
+ * Returns true if a context with the given ID exists (bound or unbound).
55
+ */
33
56
  has(id: string): boolean;
57
+ /**
58
+ * Returns the context with the given ID, or undefined if not found.
59
+ * This returns both bound and unbound contexts.
60
+ */
34
61
  get(id: string): FluidDataStoreContext | undefined;
62
+ /**
63
+ * Deletes the context with the given ID from all internal maps.
64
+ * @returns True if the context was found and deleted, false otherwise.
65
+ */
35
66
  delete(id: string): boolean;
67
+ /**
68
+ * Map of recently deleted contexts for diagnostic purposes for GC.
69
+ * Allows retrieval of context information even after deletion for logging/telemetry.
70
+ */
36
71
  private readonly _recentlyDeletedContexts;
72
+ /**
73
+ * Returns a recently deleted context by ID, or undefined if not found.
74
+ * Used for diagnostic logging for GC, when a deleted context is referenced.
75
+ */
37
76
  getRecentlyDeletedContext(id: string): FluidDataStoreContext | undefined;
38
77
  /**
39
- * Return the unbound local context with the given id,
40
- * or undefined if it's not found or not unbound.
78
+ * Returns the unbound local context with the given ID.
79
+ * @returns The unbound context, or undefined if not found or not unbound.
41
80
  */
42
81
  getUnbound(id: string): LocalFluidDataStoreContext | undefined;
43
82
  /**
44
- * Add the given context, marking it as to-be-bound
83
+ * Adds the given context to the collection, marking it as unbound (not yet locally visible).
84
+ * Asserts that no context with this ID already exists.
45
85
  */
46
86
  addUnbound(context: LocalFluidDataStoreContext): void;
47
87
  /**
@@ -51,9 +91,14 @@ export declare class DataStoreContexts implements Iterable<[string, FluidDataSto
51
91
  * @param wait - If false, return undefined if the context isn't present and ready now. Otherwise, wait for it.
52
92
  */
53
93
  getBoundOrRemoted(id: string, wait: boolean): Promise<FluidDataStoreContext | undefined>;
94
+ /**
95
+ * Gets or creates a deferred promise for the given context ID.
96
+ * Used to allow waiting for contexts that don't exist yet.
97
+ */
54
98
  private ensureDeferred;
55
99
  /**
56
- * Update this context as bound
100
+ * Marks the context with the given ID as bound (locally visible).
101
+ * Removes it from the unbound set and resolves its deferred promise.
57
102
  */
58
103
  bind(id: string): void;
59
104
  /**
@@ -62,9 +107,11 @@ export declare class DataStoreContexts implements Iterable<[string, FluidDataSto
62
107
  */
63
108
  private resolveDeferred;
64
109
  /**
65
- * Add the given context, marking it as not local-only.
66
- * This could be because it's a local context that's been bound, or because it's a remote context.
67
- * @param context - The context to add
110
+ * Adds the given context to the collection as already bound or from a remote client.
111
+ * This is used when:
112
+ * - Adding a local context that's already been bound via the bind() method, OR
113
+ * - Adding a remote context that was created by another client.
114
+ * The context's deferred promise is resolved immediately.
68
115
  */
69
116
  addBoundOrRemoted(context: FluidDataStoreContext): void;
70
117
  }
@@ -1 +1 @@
1
- {"version":3,"file":"dataStoreContexts.d.ts","sourceRoot":"","sources":["../src/dataStoreContexts.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AAOzF,OAAO,KAAK,EAAE,qBAAqB,EAAE,0BAA0B,EAAE,MAAM,uBAAuB,CAAC;AAE/F;;GAEG;AACH,qBAAa,iBACZ,YAAW,QAAQ,CAAC,CAAC,MAAM,EAAE,qBAAqB,CAAC,CAAC,EAAE,WAAW;IAEjE,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAqB;IAEtD;;OAEG;IACH,OAAO,CAAC,QAAQ,CAAC,SAAS,CAA4C;IAEtE;;;;;;OAMG;IACH,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAsD;IAGvF,OAAO,CAAC,QAAQ,CAAC,WAAW,CAiBzB;IAEH,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAsB;gBAElC,UAAU,EAAE,oBAAoB;IAI5C,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,QAAQ,CAAC,CAAC,MAAM,EAAE,qBAAqB,CAAC,CAAC;IAI9D,IAAW,IAAI,IAAI,MAAM,CAExB;IAED,IAAW,QAAQ,IAAI,OAAO,CAE7B;IACD,SAAgB,OAAO,QAAO,IAAI,CAA2B;IAEtD,cAAc,IAAI,MAAM;IAIxB,UAAU,CAAC,EAAE,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,OAAO,CAAC,eAAe;IAavB;;;;;;OAMG;IACI,iBAAiB,CAAC,OAAO,EAAE,qBAAqB,GAAG,IAAI;CAU9D"}
@@ -8,23 +8,37 @@ exports.DataStoreContexts = void 0;
8
8
  const internal_1 = require("@fluidframework/core-utils/internal");
9
9
  const internal_2 = require("@fluidframework/telemetry-utils/internal");
10
10
  /**
11
+ * Manages the collection of data store contexts, tracking their bound/unbound state.
12
+ *
13
+ * @remarks
14
+ * A context is "unbound" when it's created locally but not yet made visible (reachable from root).
15
+ * A context is "bound" once it's made locally visible, regardless of the Container's attach state.
16
+ * In attached containers, binding a context immediately sends an attach op and transitions it to Attaching state.
17
+ *
11
18
  * @internal
12
19
  */
13
20
  class DataStoreContexts {
14
21
  constructor(baseLogger) {
22
+ /**
23
+ * Set of IDs for contexts that are unbound (not yet made locally visible).
24
+ * These contexts exist locally but aren't known to other clients (even in an attached container).
25
+ */
15
26
  this.notBoundContexts = new Set();
16
27
  /**
17
- * Attached and loaded context proxies
28
+ * Map of all data store contexts (both bound and unbound).
18
29
  */
19
30
  this._contexts = new Map();
20
31
  /**
21
32
  * List of pending context waiting either to be bound or to arrive from another client.
22
33
  * This covers the case where a local context has been created but not yet bound,
23
- * or the case where a client knows a store will exist and is waiting on its creation,
34
+ * or the case where a client knows a store will exist (e.g. by alias) and is waiting on its creation,
24
35
  * so that a caller may await the deferred's promise until such a time as the context is fully ready.
25
36
  * This is a superset of _contexts, since contexts remain here once the Deferred resolves.
26
37
  */
27
38
  this.deferredContexts = new Map();
39
+ /**
40
+ * Lazy disposal logic that disposes all contexts when called.
41
+ */
28
42
  // eslint-disable-next-line unicorn/consistent-function-scoping -- Property is defined once; no need to extract inner lambda
29
43
  this.disposeOnce = new internal_1.Lazy(() => {
30
44
  // close/stop all store contexts
@@ -42,6 +56,10 @@ class DataStoreContexts {
42
56
  }
43
57
  });
44
58
  this.dispose = () => this.disposeOnce.value;
59
+ /**
60
+ * Map of recently deleted contexts for diagnostic purposes for GC.
61
+ * Allows retrieval of context information even after deletion for logging/telemetry.
62
+ */
45
63
  this._recentlyDeletedContexts = new Map();
46
64
  this._logger = (0, internal_2.createChildLogger)({ logger: baseLogger });
47
65
  }
@@ -54,18 +72,35 @@ class DataStoreContexts {
54
72
  get disposed() {
55
73
  return this.disposeOnce.evaluated;
56
74
  }
75
+ /**
76
+ * Returns the count of unbound contexts (i.e. local-only on this client)
77
+ */
57
78
  notBoundLength() {
58
79
  return this.notBoundContexts.size;
59
80
  }
81
+ /**
82
+ * Returns true if the given ID corresponds to an unbound context. (i.e. local-only on this client)
83
+ */
60
84
  isNotBound(id) {
61
85
  return this.notBoundContexts.has(id);
62
86
  }
87
+ /**
88
+ * Returns true if a context with the given ID exists (bound or unbound).
89
+ */
63
90
  has(id) {
64
91
  return this._contexts.has(id);
65
92
  }
93
+ /**
94
+ * Returns the context with the given ID, or undefined if not found.
95
+ * This returns both bound and unbound contexts.
96
+ */
66
97
  get(id) {
67
98
  return this._contexts.get(id);
68
99
  }
100
+ /**
101
+ * Deletes the context with the given ID from all internal maps.
102
+ * @returns True if the context was found and deleted, false otherwise.
103
+ */
69
104
  delete(id) {
70
105
  this.deferredContexts.delete(id);
71
106
  this.notBoundContexts.delete(id);
@@ -74,12 +109,16 @@ class DataStoreContexts {
74
109
  this._recentlyDeletedContexts.set(id, context);
75
110
  return this._contexts.delete(id);
76
111
  }
112
+ /**
113
+ * Returns a recently deleted context by ID, or undefined if not found.
114
+ * Used for diagnostic logging for GC, when a deleted context is referenced.
115
+ */
77
116
  getRecentlyDeletedContext(id) {
78
117
  return this._recentlyDeletedContexts.get(id);
79
118
  }
80
119
  /**
81
- * Return the unbound local context with the given id,
82
- * or undefined if it's not found or not unbound.
120
+ * Returns the unbound local context with the given ID.
121
+ * @returns The unbound context, or undefined if not found or not unbound.
83
122
  */
84
123
  getUnbound(id) {
85
124
  const context = this._contexts.get(id);
@@ -89,7 +128,8 @@ class DataStoreContexts {
89
128
  return context;
90
129
  }
91
130
  /**
92
- * Add the given context, marking it as to-be-bound
131
+ * Adds the given context to the collection, marking it as unbound (not yet locally visible).
132
+ * Asserts that no context with this ID already exists.
93
133
  */
94
134
  addUnbound(context) {
95
135
  const id = context.id;
@@ -111,6 +151,10 @@ class DataStoreContexts {
111
151
  }
112
152
  return deferredContext.promise;
113
153
  }
154
+ /**
155
+ * Gets or creates a deferred promise for the given context ID.
156
+ * Used to allow waiting for contexts that don't exist yet.
157
+ */
114
158
  ensureDeferred(id) {
115
159
  const deferred = this.deferredContexts.get(id);
116
160
  if (deferred) {
@@ -121,7 +165,8 @@ class DataStoreContexts {
121
165
  return newDeferred;
122
166
  }
123
167
  /**
124
- * Update this context as bound
168
+ * Marks the context with the given ID as bound (locally visible).
169
+ * Removes it from the unbound set and resolves its deferred promise.
125
170
  */
126
171
  bind(id) {
127
172
  const removed = this.notBoundContexts.delete(id);
@@ -141,9 +186,11 @@ class DataStoreContexts {
141
186
  deferred.resolve(context);
142
187
  }
143
188
  /**
144
- * Add the given context, marking it as not local-only.
145
- * This could be because it's a local context that's been bound, or because it's a remote context.
146
- * @param context - The context to add
189
+ * Adds the given context to the collection as already bound or from a remote client.
190
+ * This is used when:
191
+ * - Adding a local context that's already been bound via the bind() method, OR
192
+ * - Adding a remote context that was created by another client.
193
+ * The context's deferred promise is resolved immediately.
147
194
  */
148
195
  addBoundOrRemoted(context) {
149
196
  const id = context.id;
@@ -1 +1 @@
1
- {"version":3,"file":"dataStoreContexts.js","sourceRoot":"","sources":["../src/dataStoreContexts.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAGH,kEAA6E;AAC7E,uEAGkD;AAIlD;;GAEG;AACH,MAAa,iBAAiB;IAyC7B,YAAY,UAAgC;QAtC3B,qBAAgB,GAAG,IAAI,GAAG,EAAU,CAAC;QAEtD;;WAEG;QACc,cAAS,GAAG,IAAI,GAAG,EAAiC,CAAC;QAEtE;;;;;;WAMG;QACc,qBAAgB,GAAG,IAAI,GAAG,EAA2C,CAAC;QAEvF,4HAA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,GAAG,CAAC,EAAE,CAAC,EAC9B,KAAK,CAAC,oEAAoE,CAC1E,CAAC;QAEF,MAAM,QAAQ,GAAG,IAAI,CAAC,gBAAgB,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QAC/C,IAAA,iBAAM,EAAC,CAAC,CAAC,QAAQ,EAAE,KAAK,CAAC,uCAAuC,CAAC,CAAC;QAClE,QAAQ,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;IAC3B,CAAC;IAED;;;;OAIG;IACI,iBAAiB,CAAC,OAA8B;QACtD,MAAM,EAAE,GAAG,OAAO,CAAC,EAAE,CAAC;QACtB,IAAA,iBAAM,EAAC,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,KAAK,CAAC,uCAAuC,CAAC,CAAC;QAE/E,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,EAAE,EAAE,OAAO,CAAC,CAAC;QAEhC,qEAAqE;QACrE,IAAI,CAAC,cAAc,CAAC,EAAE,CAAC,CAAC;QACxB,IAAI,CAAC,eAAe,CAAC,EAAE,CAAC,CAAC;IAC1B,CAAC;CACD;AA9LD,8CA8LC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { IDisposable, ITelemetryBaseLogger } from \"@fluidframework/core-interfaces\";\nimport { assert, Deferred, Lazy } from \"@fluidframework/core-utils/internal\";\nimport {\n\ttype ITelemetryLoggerExt,\n\tcreateChildLogger,\n} from \"@fluidframework/telemetry-utils/internal\";\n\nimport type { FluidDataStoreContext, LocalFluidDataStoreContext } from \"./dataStoreContext.js\";\n\n/**\n * @internal\n */\nexport class DataStoreContexts\n\timplements Iterable<[string, FluidDataStoreContext]>, IDisposable\n{\n\tprivate readonly notBoundContexts = new Set<string>();\n\n\t/**\n\t * Attached and loaded context proxies\n\t */\n\tprivate readonly _contexts = new Map<string, FluidDataStoreContext>();\n\n\t/**\n\t * List of pending context waiting either to be bound or to arrive from another client.\n\t * This covers the case where a local context has been created but not yet bound,\n\t * or the case where a client knows a store will exist and is waiting on its creation,\n\t * so that a caller may await the deferred's promise until such a time as the context is fully ready.\n\t * This is a superset of _contexts, since contexts remain here once the Deferred resolves.\n\t */\n\tprivate readonly deferredContexts = new Map<string, Deferred<FluidDataStoreContext>>();\n\n\t// eslint-disable-next-line unicorn/consistent-function-scoping -- Property is defined once; no need to extract inner lambda\n\tprivate readonly disposeOnce = new Lazy<void>(() => {\n\t\t// close/stop all store contexts\n\t\tfor (const [fluidDataStoreId, contextD] of this.deferredContexts) {\n\t\t\tcontextD.promise\n\t\t\t\t.then((context) => {\n\t\t\t\t\tcontext.dispose();\n\t\t\t\t})\n\t\t\t\t.catch((contextError) => {\n\t\t\t\t\tthis._logger.sendErrorEvent(\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\teventName: \"FluidDataStoreContextDisposeError\",\n\t\t\t\t\t\t\tfluidDataStoreId,\n\t\t\t\t\t\t},\n\t\t\t\t\t\tcontextError,\n\t\t\t\t\t);\n\t\t\t\t});\n\t\t}\n\t});\n\n\tprivate readonly _logger: ITelemetryLoggerExt;\n\n\tconstructor(baseLogger: ITelemetryBaseLogger) {\n\t\tthis._logger = createChildLogger({ logger: baseLogger });\n\t}\n\n\t[Symbol.iterator](): Iterator<[string, FluidDataStoreContext]> {\n\t\treturn this._contexts.entries();\n\t}\n\n\tpublic get size(): number {\n\t\treturn this._contexts.size;\n\t}\n\n\tpublic get disposed(): boolean {\n\t\treturn this.disposeOnce.evaluated;\n\t}\n\tpublic readonly dispose = (): void => this.disposeOnce.value;\n\n\tpublic notBoundLength(): number {\n\t\treturn this.notBoundContexts.size;\n\t}\n\n\tpublic isNotBound(id: string): boolean {\n\t\treturn this.notBoundContexts.has(id);\n\t}\n\n\tpublic has(id: string): boolean {\n\t\treturn this._contexts.has(id);\n\t}\n\n\tpublic get(id: string): FluidDataStoreContext | undefined {\n\t\treturn this._contexts.get(id);\n\t}\n\n\tpublic delete(id: string): boolean {\n\t\tthis.deferredContexts.delete(id);\n\t\tthis.notBoundContexts.delete(id);\n\n\t\t// Stash the context here in case it's requested in this session, we can log some details about it\n\t\tconst context = this._contexts.get(id);\n\t\tthis._recentlyDeletedContexts.set(id, context);\n\n\t\treturn this._contexts.delete(id);\n\t}\n\n\tprivate readonly _recentlyDeletedContexts: Map<string, FluidDataStoreContext | undefined> =\n\t\tnew Map();\n\n\tpublic getRecentlyDeletedContext(id: string): FluidDataStoreContext | undefined {\n\t\treturn this._recentlyDeletedContexts.get(id);\n\t}\n\n\t/**\n\t * Return the unbound local context with the given id,\n\t * or undefined if it's not found or not unbound.\n\t */\n\tpublic getUnbound(id: string): LocalFluidDataStoreContext | undefined {\n\t\tconst context = this._contexts.get(id);\n\t\tif (context === undefined || !this.notBoundContexts.has(id)) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\treturn context as LocalFluidDataStoreContext;\n\t}\n\n\t/**\n\t * Add the given context, marking it as to-be-bound\n\t */\n\tpublic addUnbound(context: LocalFluidDataStoreContext): void {\n\t\tconst id = context.id;\n\t\tassert(!this._contexts.has(id), 0x158 /* \"Creating store with existing ID\" */);\n\n\t\tthis._contexts.set(id, context);\n\n\t\tthis.notBoundContexts.add(id);\n\t\tthis.ensureDeferred(id);\n\t}\n\n\t/**\n\t * Get the context with the given id, once it exists locally and is attached.\n\t * e.g. If created locally, it must be bound, or if created remotely then it's fine as soon as it's sync'd in.\n\t * @param id - The id of the context to get\n\t * @param wait - If false, return undefined if the context isn't present and ready now. Otherwise, wait for it.\n\t */\n\tpublic async getBoundOrRemoted(\n\t\tid: string,\n\t\twait: boolean,\n\t): Promise<FluidDataStoreContext | undefined> {\n\t\tconst deferredContext = this.ensureDeferred(id);\n\n\t\tif (!wait && !deferredContext.isCompleted) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\treturn deferredContext.promise;\n\t}\n\n\tprivate ensureDeferred(id: string): Deferred<FluidDataStoreContext> {\n\t\tconst deferred = this.deferredContexts.get(id);\n\t\tif (deferred) {\n\t\t\treturn deferred;\n\t\t}\n\n\t\tconst newDeferred = new Deferred<FluidDataStoreContext>();\n\t\tthis.deferredContexts.set(id, newDeferred);\n\t\treturn newDeferred;\n\t}\n\n\t/**\n\t * Update this context as bound\n\t */\n\tpublic bind(id: string): void {\n\t\tconst removed: boolean = this.notBoundContexts.delete(id);\n\t\tassert(removed, 0x159 /* \"The given id was not found in notBoundContexts to delete\" */);\n\n\t\tthis.resolveDeferred(id);\n\t}\n\n\t/**\n\t * Triggers the deferred to resolve, indicating the context is not local-only\n\t * @param id - The id of the context to resolve to\n\t */\n\tprivate resolveDeferred(id: string): void {\n\t\tconst context = this._contexts.get(id);\n\t\tassert(!!context, 0x15a /* \"Cannot find context to resolve to\" */);\n\t\tassert(\n\t\t\t!this.notBoundContexts.has(id),\n\t\t\t0x15b /* \"Expected this id to already be removed from notBoundContexts\" */,\n\t\t);\n\n\t\tconst deferred = this.deferredContexts.get(id);\n\t\tassert(!!deferred, 0x15c /* \"Cannot find deferred to resolve\" */);\n\t\tdeferred.resolve(context);\n\t}\n\n\t/**\n\t * Add the given context, marking it as not local-only.\n\t * This could be because it's a local context that's been bound, or because it's a remote context.\n\t * @param context - The context to add\n\t */\n\tpublic addBoundOrRemoted(context: FluidDataStoreContext): void {\n\t\tconst id = context.id;\n\t\tassert(!this._contexts.has(id), 0x15d /* \"Creating store with existing ID\" */);\n\n\t\tthis._contexts.set(id, context);\n\n\t\t// Resolve the deferred immediately since this context is not unbound\n\t\tthis.ensureDeferred(id);\n\t\tthis.resolveDeferred(id);\n\t}\n}\n"]}
1
+ {"version":3,"file":"dataStoreContexts.js","sourceRoot":"","sources":["../src/dataStoreContexts.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAGH,kEAA6E;AAC7E,uEAGkD;AAIlD;;;;;;;;;GASG;AACH,MAAa,iBAAiB;IAgD7B,YAAY,UAAgC;QA7C5C;;;WAGG;QACc,qBAAgB,GAAG,IAAI,GA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CAAC;IAED;;;OAGG;IACK,eAAe,CAAC,EAAU;QACjC,MAAM,OAAO,GAAG,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QACvC,IAAA,iBAAM,EAAC,CAAC,CAAC,OAAO,EAAE,KAAK,CAAC,yCAAyC,CAAC,CAAC;QACnE,IAAA,iBAAM,EACL,CAAC,IAAI,CAAC,gBAAgB,CAAC,GAAG,CAAC,EAAE,CAAC,EAC9B,KAAK,CAAC,oEAAoE,CAC1E,CAAC;QAEF,MAAM,QAAQ,GAAG,IAAI,CAAC,gBAAgB,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QAC/C,IAAA,iBAAM,EAAC,CAAC,CAAC,QAAQ,EAAE,KAAK,CAAC,uCAAuC,CAAC,CAAC;QAClE,QAAQ,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;IAC3B,CAAC;IAED;;;;;;OAMG;IACI,iBAAiB,CAAC,OAA8B;QACtD,MAAM,EAAE,GAAG,OAAO,CAAC,EAAE,CAAC;QACtB,IAAA,iBAAM,EAAC,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,KAAK,CAAC,uCAAuC,CAAC,CAAC;QAE/E,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,EAAE,EAAE,OAAO,CAAC,CAAC;QAEhC,qEAAqE;QACrE,IAAI,CAAC,cAAc,CAAC,EAAE,CAAC,CAAC;QACxB,IAAI,CAAC,eAAe,CAAC,EAAE,CAAC,CAAC;IAC1B,CAAC;CACD;AAtOD,8CAsOC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { IDisposable, ITelemetryBaseLogger } from \"@fluidframework/core-interfaces\";\nimport { assert, Deferred, Lazy } from \"@fluidframework/core-utils/internal\";\nimport {\n\ttype ITelemetryLoggerExt,\n\tcreateChildLogger,\n} from \"@fluidframework/telemetry-utils/internal\";\n\nimport type { FluidDataStoreContext, LocalFluidDataStoreContext } from \"./dataStoreContext.js\";\n\n/**\n * Manages the collection of data store contexts, tracking their bound/unbound state.\n *\n * @remarks\n * A context is \"unbound\" when it's created locally but not yet made visible (reachable from root).\n * A context is \"bound\" once it's made locally visible, regardless of the Container's attach state.\n * In attached containers, binding a context immediately sends an attach op and transitions it to Attaching state.\n *\n * @internal\n */\nexport class DataStoreContexts\n\timplements Iterable<[string, FluidDataStoreContext]>, IDisposable\n{\n\t/**\n\t * Set of IDs for contexts that are unbound (not yet made locally visible).\n\t * These contexts exist locally but aren't known to other clients (even in an attached container).\n\t */\n\tprivate readonly notBoundContexts = new Set<string>();\n\n\t/**\n\t * Map of all data store contexts (both bound and unbound).\n\t */\n\tprivate readonly _contexts = new Map<string, FluidDataStoreContext>();\n\n\t/**\n\t * List of pending context waiting either to be bound or to arrive from another client.\n\t * This covers the case where a local context has been created but not yet bound,\n\t * or the case where a client knows a store will exist (e.g. by alias) and is waiting on its creation,\n\t * so that a caller may await the deferred's promise until such a time as the context is fully ready.\n\t * This is a superset of _contexts, since contexts remain here once the Deferred resolves.\n\t */\n\tprivate readonly deferredContexts = new Map<string, Deferred<FluidDataStoreContext>>();\n\n\t/**\n\t * Lazy disposal logic that disposes all contexts when called.\n\t */\n\t// eslint-disable-next-line unicorn/consistent-function-scoping -- Property is defined once; no need to extract inner lambda\n\tprivate readonly disposeOnce = new Lazy<void>(() => {\n\t\t// close/stop all store contexts\n\t\tfor (const [fluidDataStoreId, contextD] of this.deferredContexts) {\n\t\t\tcontextD.promise\n\t\t\t\t.then((context) => {\n\t\t\t\t\tcontext.dispose();\n\t\t\t\t})\n\t\t\t\t.catch((contextError) => {\n\t\t\t\t\tthis._logger.sendErrorEvent(\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\teventName: \"FluidDataStoreContextDisposeError\",\n\t\t\t\t\t\t\tfluidDataStoreId,\n\t\t\t\t\t\t},\n\t\t\t\t\t\tcontextError,\n\t\t\t\t\t);\n\t\t\t\t});\n\t\t}\n\t});\n\n\tprivate readonly _logger: ITelemetryLoggerExt;\n\n\tconstructor(baseLogger: ITelemetryBaseLogger) {\n\t\tthis._logger = createChildLogger({ logger: baseLogger });\n\t}\n\n\t[Symbol.iterator](): Iterator<[string, FluidDataStoreContext]> {\n\t\treturn this._contexts.entries();\n\t}\n\n\tpublic get size(): number {\n\t\treturn this._contexts.size;\n\t}\n\n\tpublic get disposed(): boolean {\n\t\treturn this.disposeOnce.evaluated;\n\t}\n\tpublic readonly dispose = (): void => this.disposeOnce.value;\n\n\t/**\n\t * Returns the count of unbound contexts (i.e. local-only on this client)\n\t */\n\tpublic notBoundLength(): number {\n\t\treturn this.notBoundContexts.size;\n\t}\n\n\t/**\n\t * Returns true if the given ID corresponds to an unbound context. (i.e. local-only on this client)\n\t */\n\tpublic isNotBound(id: string): boolean {\n\t\treturn this.notBoundContexts.has(id);\n\t}\n\n\t/**\n\t * Returns true if a context with the given ID exists (bound or unbound).\n\t */\n\tpublic has(id: string): boolean {\n\t\treturn this._contexts.has(id);\n\t}\n\n\t/**\n\t * Returns the context with the given ID, or undefined if not found.\n\t * This returns both bound and unbound contexts.\n\t */\n\tpublic get(id: string): FluidDataStoreContext | undefined {\n\t\treturn this._contexts.get(id);\n\t}\n\n\t/**\n\t * Deletes the context with the given ID from all internal maps.\n\t * @returns True if the context was found and deleted, false otherwise.\n\t */\n\tpublic delete(id: string): boolean {\n\t\tthis.deferredContexts.delete(id);\n\t\tthis.notBoundContexts.delete(id);\n\n\t\t// Stash the context here in case it's requested in this session, we can log some details about it\n\t\tconst context = this._contexts.get(id);\n\t\tthis._recentlyDeletedContexts.set(id, context);\n\n\t\treturn this._contexts.delete(id);\n\t}\n\n\t/**\n\t * Map of recently deleted contexts for diagnostic purposes for GC.\n\t * Allows retrieval of context information even after deletion for logging/telemetry.\n\t */\n\tprivate readonly _recentlyDeletedContexts: Map<string, FluidDataStoreContext | undefined> =\n\t\tnew Map();\n\n\t/**\n\t * Returns a recently deleted context by ID, or undefined if not found.\n\t * Used for diagnostic logging for GC, when a deleted context is referenced.\n\t */\n\tpublic getRecentlyDeletedContext(id: string): FluidDataStoreContext | undefined {\n\t\treturn this._recentlyDeletedContexts.get(id);\n\t}\n\n\t/**\n\t * Returns the unbound local context with the given ID.\n\t * @returns The unbound context, or undefined if not found or not unbound.\n\t */\n\tpublic getUnbound(id: string): LocalFluidDataStoreContext | undefined {\n\t\tconst context = this._contexts.get(id);\n\t\tif (context === undefined || !this.notBoundContexts.has(id)) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\treturn context as LocalFluidDataStoreContext;\n\t}\n\n\t/**\n\t * Adds the given context to the collection, marking it as unbound (not yet locally visible).\n\t * Asserts that no context with this ID already exists.\n\t */\n\tpublic addUnbound(context: LocalFluidDataStoreContext): void {\n\t\tconst id = context.id;\n\t\tassert(!this._contexts.has(id), 0x158 /* \"Creating store with existing ID\" */);\n\n\t\tthis._contexts.set(id, context);\n\n\t\tthis.notBoundContexts.add(id);\n\t\tthis.ensureDeferred(id);\n\t}\n\n\t/**\n\t * Get the context with the given id, once it exists locally and is attached.\n\t * e.g. If created locally, it must be bound, or if created remotely then it's fine as soon as it's sync'd in.\n\t * @param id - The id of the context to get\n\t * @param wait - If false, return undefined if the context isn't present and ready now. Otherwise, wait for it.\n\t */\n\tpublic async getBoundOrRemoted(\n\t\tid: string,\n\t\twait: boolean,\n\t): Promise<FluidDataStoreContext | undefined> {\n\t\tconst deferredContext = this.ensureDeferred(id);\n\n\t\tif (!wait && !deferredContext.isCompleted) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\treturn deferredContext.promise;\n\t}\n\n\t/**\n\t * Gets or creates a deferred promise for the given context ID.\n\t * Used to allow waiting for contexts that don't exist yet.\n\t */\n\tprivate ensureDeferred(id: string): Deferred<FluidDataStoreContext> {\n\t\tconst deferred = this.deferredContexts.get(id);\n\t\tif (deferred) {\n\t\t\treturn deferred;\n\t\t}\n\n\t\tconst newDeferred = new Deferred<FluidDataStoreContext>();\n\t\tthis.deferredContexts.set(id, newDeferred);\n\t\treturn newDeferred;\n\t}\n\n\t/**\n\t * Marks the context with the given ID as bound (locally visible).\n\t * Removes it from the unbound set and resolves its deferred promise.\n\t */\n\tpublic bind(id: string): void {\n\t\tconst removed: boolean = this.notBoundContexts.delete(id);\n\t\tassert(removed, 0x159 /* \"The given id was not found in notBoundContexts to delete\" */);\n\n\t\tthis.resolveDeferred(id);\n\t}\n\n\t/**\n\t * Triggers the deferred to resolve, indicating the context is not local-only\n\t * @param id - The id of the context to resolve to\n\t */\n\tprivate resolveDeferred(id: string): void {\n\t\tconst context = this._contexts.get(id);\n\t\tassert(!!context, 0x15a /* \"Cannot find context to resolve to\" */);\n\t\tassert(\n\t\t\t!this.notBoundContexts.has(id),\n\t\t\t0x15b /* \"Expected this id to already be removed from notBoundContexts\" */,\n\t\t);\n\n\t\tconst deferred = this.deferredContexts.get(id);\n\t\tassert(!!deferred, 0x15c /* \"Cannot find deferred to resolve\" */);\n\t\tdeferred.resolve(context);\n\t}\n\n\t/**\n\t * Adds the given context to the collection as already bound or from a remote client.\n\t * This is used when:\n\t * - Adding a local context that's already been bound via the bind() method, OR\n\t * - Adding a remote context that was created by another client.\n\t * The context's deferred promise is resolved immediately.\n\t */\n\tpublic addBoundOrRemoted(context: FluidDataStoreContext): void {\n\t\tconst id = context.id;\n\t\tassert(!this._contexts.has(id), 0x15d /* \"Creating store with existing ID\" */);\n\n\t\tthis._contexts.set(id, context);\n\n\t\t// Resolve the deferred immediately since this context is not unbound\n\t\tthis.ensureDeferred(id);\n\t\tthis.resolveDeferred(id);\n\t}\n}\n"]}
@@ -5,5 +5,5 @@
5
5
  * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY
6
6
  */
7
7
  export declare const pkgName = "@fluidframework/container-runtime";
8
- export declare const pkgVersion = "2.74.0-368706";
8
+ export declare const pkgVersion = "2.74.0";
9
9
  //# sourceMappingURL=packageVersion.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"packageVersion.d.ts","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,eAAO,MAAM,OAAO,sCAAsC,CAAC;AAC3D,eAAO,MAAM,UAAU,kBAAkB,CAAC"}
1
+ {"version":3,"file":"packageVersion.d.ts","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,eAAO,MAAM,OAAO,sCAAsC,CAAC;AAC3D,eAAO,MAAM,UAAU,WAAW,CAAC"}
@@ -8,5 +8,5 @@
8
8
  Object.defineProperty(exports, "__esModule", { value: true });
9
9
  exports.pkgVersion = exports.pkgName = void 0;
10
10
  exports.pkgName = "@fluidframework/container-runtime";
11
- exports.pkgVersion = "2.74.0-368706";
11
+ exports.pkgVersion = "2.74.0";
12
12
  //# sourceMappingURL=packageVersion.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEU,QAAA,OAAO,GAAG,mCAAmC,CAAC;AAC9C,QAAA,UAAU,GAAG,eAAe,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-runtime\";\nexport const pkgVersion = \"2.74.0-368706\";\n"]}
1
+ {"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEU,QAAA,OAAO,GAAG,mCAAmC,CAAC;AAC9C,QAAA,UAAU,GAAG,QAAQ,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-runtime\";\nexport const pkgVersion = \"2.74.0\";\n"]}
@@ -13,11 +13,11 @@ export declare const runtimeCoreCompatDetails: {
13
13
  /**
14
14
  * The package version of the Runtime layer.
15
15
  */
16
- readonly pkgVersion: "2.74.0-368706";
16
+ readonly pkgVersion: "2.74.0";
17
17
  /**
18
18
  * The current generation of the Runtime layer.
19
19
  */
20
- readonly generation: 2;
20
+ readonly generation: 3;
21
21
  };
22
22
  /**
23
23
  * Runtime's compatibility details that is exposed to the Loader layer.
@@ -20,7 +20,7 @@ exports.runtimeCoreCompatDetails = {
20
20
  /**
21
21
  * The current generation of the Runtime layer.
22
22
  */
23
- generation: 2,
23
+ generation: 3,
24
24
  };
25
25
  /**
26
26
  * Runtime's compatibility details that is exposed to the Loader layer.
@@ -1 +1 @@
1
- {"version":3,"file":"runtimeLayerCompatState.js","sourceRoot":"","sources":["../src/runtimeLayerCompatState.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAOH,2EAGsD;AACtD,uEAGkD;AAElD,2DAAiD;AAEjD;;;GAGG;AACU,QAAA,wBAAwB,GAAG;IACvC;;OAEG;IACH,UAAU,EAAV,8BAAU;IACV;;OAEG;IACH,UAAU,EAAE,CAAC;CACJ,CAAC;AAEX;;;GAGG;AACU,QAAA,6BAA6B,GAAwB;IACjE,GAAG,gCAAwB;IAC3B;;OAEG;IACH,iBAAiB,EAAE,IAAI,GAAG,EAAU;CACpC,CAAC;AAEF;;;GAGG;AACU,QAAA,mCAAmC,GAAoC;IACnF;;;OAGG;IACH,sBAAsB,EAAE,CAAC;IACzB;;OAEG;IACH,gBAAgB,EAAE,EAAE;CACpB,CAAC;AAEF;;;GAGG;AACU,QAAA,gCAAgC,GAAwB;IACpE,GAAG,gCAAwB;IAC3B;;OAEG;IACH,iBAAiB,EAAE,IAAI,GAAG,CAAS,CAAC,0CAA+B,EAAE,gCAAqB,CAAC,CAAC;CAC5F,CAAC;AAEF;;;GAGG;AACU,QAAA,sCAAsC,GAAoC;IACtF;;;OAGG;IACH,sBAAsB,EAAE,CAAC;IACzB;;OAEG;IACH,gBAAgB,EAAE,EAAE;CACpB,CAAC;AAEF;;;GAGG;AACH,SAAgB,2BAA2B,CAC1C,kCAAmE,EACnE,SAAoD,EACpD,MAA2B;IAE3B,IAAA,qCAA0B,EACzB,SAAS,EACT,QAAQ,EACR,qCAA6B,EAC7B,2CAAmC,EACnC,kCAAkC,EAClC,SAAS,EACT,MAAM,CACN,CAAC;AACH,CAAC;AAdD,kEAcC;AAED;;;GAGG;AACH,SAAgB,8BAA8B,CAC7C,qCAAsE,EACtE,SAAqB,EACrB,MAA2B;IAE3B,IAAA,qCAA0B,EACzB,SAAS,EACT,WAAW,EACX,wCAAgC,EAChC,8CAAsC,EACtC,qCAAqC,EACrC,SAAS,EACT,MAAM,CACN,CAAC;AACH,CAAC;AAdD,wEAcC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type {\n\tILayerCompatDetails,\n\tILayerCompatSupportRequirements,\n} from \"@fluid-internal/client-utils\";\nimport type { ICriticalContainerError } from \"@fluidframework/container-definitions\";\nimport {\n\tencodeHandlesInContainerRuntime,\n\tnotifiesReadOnlyState,\n} from \"@fluidframework/runtime-definitions/internal\";\nimport {\n\tvalidateLayerCompatibility,\n\ttype ITelemetryLoggerExt,\n} from \"@fluidframework/telemetry-utils/internal\";\n\nimport { pkgVersion } from \"./packageVersion.js\";\n\n/**\n * The core compatibility details of the Runtime layer that is the same across all layer boundaries.\n * @internal\n */\nexport const runtimeCoreCompatDetails = {\n\t/**\n\t * The package version of the Runtime layer.\n\t */\n\tpkgVersion,\n\t/**\n\t * The current generation of the Runtime layer.\n\t */\n\tgeneration: 2,\n} as const;\n\n/**\n * Runtime's compatibility details that is exposed to the Loader layer.\n * @internal\n */\nexport const runtimeCompatDetailsForLoader: ILayerCompatDetails = {\n\t...runtimeCoreCompatDetails,\n\t/**\n\t * The features supported by the Runtime layer across the Runtime / Loader boundary.\n\t */\n\tsupportedFeatures: new Set<string>(),\n};\n\n/**\n * The requirements that the Loader layer must meet to be compatible with this Runtime.\n * @internal\n */\nexport const loaderSupportRequirementsForRuntime: ILayerCompatSupportRequirements = {\n\t/**\n\t * Minimum generation that Loader must be at to be compatible with Runtime. Note that 0 is used here so\n\t * that Loader layers before the introduction of the layer compatibility enforcement are compatible.\n\t */\n\tminSupportedGeneration: 0,\n\t/**\n\t * The features that the Loader must support to be compatible with Runtime.\n\t */\n\trequiredFeatures: [],\n};\n\n/**\n * Runtime's compatibility details that is exposed to the DataStore layer.\n * @internal\n */\nexport const runtimeCompatDetailsForDataStore: ILayerCompatDetails = {\n\t...runtimeCoreCompatDetails,\n\t/**\n\t * The features supported by the Runtime layer across the Runtime / DataStore boundary.\n\t */\n\tsupportedFeatures: new Set<string>([encodeHandlesInContainerRuntime, notifiesReadOnlyState]),\n};\n\n/**\n * The requirements that the DataStore layer must meet to be compatible with this Runtime.\n * @internal\n */\nexport const dataStoreSupportRequirementsForRuntime: ILayerCompatSupportRequirements = {\n\t/**\n\t * Minimum generation that DataStore must be at to be compatible with Runtime. Note that 0 is used here so\n\t * that DataStore layers before the introduction of the layer compatibility enforcement are compatible.\n\t */\n\tminSupportedGeneration: 0,\n\t/**\n\t * The features that the DataStore must support to be compatible with Runtime.\n\t */\n\trequiredFeatures: [],\n};\n\n/**\n * Validates that the Loader layer is compatible with this Runtime.\n * @internal\n */\nexport function validateLoaderCompatibility(\n\tmaybeLoaderCompatDetailsForRuntime: ILayerCompatDetails | undefined,\n\tdisposeFn: (error?: ICriticalContainerError) => void,\n\tlogger: ITelemetryLoggerExt,\n): void {\n\tvalidateLayerCompatibility(\n\t\t\"runtime\",\n\t\t\"loader\",\n\t\truntimeCompatDetailsForLoader,\n\t\tloaderSupportRequirementsForRuntime,\n\t\tmaybeLoaderCompatDetailsForRuntime,\n\t\tdisposeFn,\n\t\tlogger,\n\t);\n}\n\n/**\n * Validates that the DataStore layer is compatible with this Runtime.\n * @internal\n */\nexport function validateDatastoreCompatibility(\n\tmaybeDataStoreCompatDetailsForRuntime: ILayerCompatDetails | undefined,\n\tdisposeFn: () => void,\n\tlogger: ITelemetryLoggerExt,\n): void {\n\tvalidateLayerCompatibility(\n\t\t\"runtime\",\n\t\t\"dataStore\",\n\t\truntimeCompatDetailsForDataStore,\n\t\tdataStoreSupportRequirementsForRuntime,\n\t\tmaybeDataStoreCompatDetailsForRuntime,\n\t\tdisposeFn,\n\t\tlogger,\n\t);\n}\n"]}
1
+ {"version":3,"file":"runtimeLayerCompatState.js","sourceRoot":"","sources":["../src/runtimeLayerCompatState.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAOH,2EAGsD;AACtD,uEAGkD;AAElD,2DAAiD;AAEjD;;;GAGG;AACU,QAAA,wBAAwB,GAAG;IACvC;;OAEG;IACH,UAAU,EAAV,8BAAU;IACV;;OAEG;IACH,UAAU,EAAE,CAAC;CACJ,CAAC;AAEX;;;GAGG;AACU,QAAA,6BAA6B,GAAwB;IACjE,GAAG,gCAAwB;IAC3B;;OAEG;IACH,iBAAiB,EAAE,IAAI,GAAG,EAAU;CACpC,CAAC;AAEF;;;GAGG;AACU,QAAA,mCAAmC,GAAoC;IACnF;;;OAGG;IACH,sBAAsB,EAAE,CAAC;IACzB;;OAEG;IACH,gBAAgB,EAAE,EAAE;CACpB,CAAC;AAEF;;;GAGG;AACU,QAAA,gCAAgC,GAAwB;IACpE,GAAG,gCAAwB;IAC3B;;OAEG;IACH,iBAAiB,EAAE,IAAI,GAAG,CAAS,CAAC,0CAA+B,EAAE,gCAAqB,CAAC,CAAC;CAC5F,CAAC;AAEF;;;GAGG;AACU,QAAA,sCAAsC,GAAoC;IACtF;;;OAGG;IACH,sBAAsB,EAAE,CAAC;IACzB;;OAEG;IACH,gBAAgB,EAAE,EAAE;CACpB,CAAC;AAEF;;;GAGG;AACH,SAAgB,2BAA2B,CAC1C,kCAAmE,EACnE,SAAoD,EACpD,MAA2B;IAE3B,IAAA,qCAA0B,EACzB,SAAS,EACT,QAAQ,EACR,qCAA6B,EAC7B,2CAAmC,EACnC,kCAAkC,EAClC,SAAS,EACT,MAAM,CACN,CAAC;AACH,CAAC;AAdD,kEAcC;AAED;;;GAGG;AACH,SAAgB,8BAA8B,CAC7C,qCAAsE,EACtE,SAAqB,EACrB,MAA2B;IAE3B,IAAA,qCAA0B,EACzB,SAAS,EACT,WAAW,EACX,wCAAgC,EAChC,8CAAsC,EACtC,qCAAqC,EACrC,SAAS,EACT,MAAM,CACN,CAAC;AACH,CAAC;AAdD,wEAcC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type {\n\tILayerCompatDetails,\n\tILayerCompatSupportRequirements,\n} from \"@fluid-internal/client-utils\";\nimport type { ICriticalContainerError } from \"@fluidframework/container-definitions\";\nimport {\n\tencodeHandlesInContainerRuntime,\n\tnotifiesReadOnlyState,\n} from \"@fluidframework/runtime-definitions/internal\";\nimport {\n\tvalidateLayerCompatibility,\n\ttype ITelemetryLoggerExt,\n} from \"@fluidframework/telemetry-utils/internal\";\n\nimport { pkgVersion } from \"./packageVersion.js\";\n\n/**\n * The core compatibility details of the Runtime layer that is the same across all layer boundaries.\n * @internal\n */\nexport const runtimeCoreCompatDetails = {\n\t/**\n\t * The package version of the Runtime layer.\n\t */\n\tpkgVersion,\n\t/**\n\t * The current generation of the Runtime layer.\n\t */\n\tgeneration: 3,\n} as const;\n\n/**\n * Runtime's compatibility details that is exposed to the Loader layer.\n * @internal\n */\nexport const runtimeCompatDetailsForLoader: ILayerCompatDetails = {\n\t...runtimeCoreCompatDetails,\n\t/**\n\t * The features supported by the Runtime layer across the Runtime / Loader boundary.\n\t */\n\tsupportedFeatures: new Set<string>(),\n};\n\n/**\n * The requirements that the Loader layer must meet to be compatible with this Runtime.\n * @internal\n */\nexport const loaderSupportRequirementsForRuntime: ILayerCompatSupportRequirements = {\n\t/**\n\t * Minimum generation that Loader must be at to be compatible with Runtime. Note that 0 is used here so\n\t * that Loader layers before the introduction of the layer compatibility enforcement are compatible.\n\t */\n\tminSupportedGeneration: 0,\n\t/**\n\t * The features that the Loader must support to be compatible with Runtime.\n\t */\n\trequiredFeatures: [],\n};\n\n/**\n * Runtime's compatibility details that is exposed to the DataStore layer.\n * @internal\n */\nexport const runtimeCompatDetailsForDataStore: ILayerCompatDetails = {\n\t...runtimeCoreCompatDetails,\n\t/**\n\t * The features supported by the Runtime layer across the Runtime / DataStore boundary.\n\t */\n\tsupportedFeatures: new Set<string>([encodeHandlesInContainerRuntime, notifiesReadOnlyState]),\n};\n\n/**\n * The requirements that the DataStore layer must meet to be compatible with this Runtime.\n * @internal\n */\nexport const dataStoreSupportRequirementsForRuntime: ILayerCompatSupportRequirements = {\n\t/**\n\t * Minimum generation that DataStore must be at to be compatible with Runtime. Note that 0 is used here so\n\t * that DataStore layers before the introduction of the layer compatibility enforcement are compatible.\n\t */\n\tminSupportedGeneration: 0,\n\t/**\n\t * The features that the DataStore must support to be compatible with Runtime.\n\t */\n\trequiredFeatures: [],\n};\n\n/**\n * Validates that the Loader layer is compatible with this Runtime.\n * @internal\n */\nexport function validateLoaderCompatibility(\n\tmaybeLoaderCompatDetailsForRuntime: ILayerCompatDetails | undefined,\n\tdisposeFn: (error?: ICriticalContainerError) => void,\n\tlogger: ITelemetryLoggerExt,\n): void {\n\tvalidateLayerCompatibility(\n\t\t\"runtime\",\n\t\t\"loader\",\n\t\truntimeCompatDetailsForLoader,\n\t\tloaderSupportRequirementsForRuntime,\n\t\tmaybeLoaderCompatDetailsForRuntime,\n\t\tdisposeFn,\n\t\tlogger,\n\t);\n}\n\n/**\n * Validates that the DataStore layer is compatible with this Runtime.\n * @internal\n */\nexport function validateDatastoreCompatibility(\n\tmaybeDataStoreCompatDetailsForRuntime: ILayerCompatDetails | undefined,\n\tdisposeFn: () => void,\n\tlogger: ITelemetryLoggerExt,\n): void {\n\tvalidateLayerCompatibility(\n\t\t\"runtime\",\n\t\t\"dataStore\",\n\t\truntimeCompatDetailsForDataStore,\n\t\tdataStoreSupportRequirementsForRuntime,\n\t\tmaybeDataStoreCompatDetailsForRuntime,\n\t\tdisposeFn,\n\t\tlogger,\n\t);\n}\n"]}
@@ -0,0 +1,31 @@
1
+ /* eslint-disable */
2
+ /**
3
+ * GENERATED FILE - DO NOT EDIT DIRECTLY.
4
+ * To regenerate: pnpm tsx scripts/generate-flat-eslint-configs.ts --typescript
5
+ */
6
+ import type { Linter } from "eslint";
7
+ import { recommended } from "../../../common/build/eslint-config-fluid/flat.mts";
8
+
9
+ const config: Linter.Config[] = [
10
+ ...recommended,
11
+ {
12
+ rules: {
13
+ "@typescript-eslint/unbound-method": "off",
14
+ },
15
+ },
16
+ {
17
+ files: ["*.spec.ts", "src/test/**"],
18
+ rules: {
19
+ "@typescript-eslint/explicit-function-return-type": "off",
20
+ "unicorn/consistent-function-scoping": "off",
21
+ "import-x/no-nodejs-modules": [
22
+ "error",
23
+ {
24
+ "allow": ["node:assert", "node:crypto"],
25
+ },
26
+ ],
27
+ },
28
+ },
29
+ ];
30
+
31
+ export default config;
@@ -1 +1 @@
1
- {"version":3,"file":"channelCollection.d.ts","sourceRoot":"","sources":["../src/channelCollection.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,uCAAuC,CAAC;AACpE,OAAO,KAAK,EACX,WAAW,EACX,WAAW,EACX,QAAQ,EACR,SAAS,EACT,oBAAoB,EACpB,MAAM,iCAAiC,CAAC;AACzC,OAAO,KAAK,EACX,oBAAoB,EACpB,eAAe,EACf,MAAM,0CAA0C,CAAC;AAGlD,OAAO,KAAK,EACX,SAAS,EACT,aAAa,EAEb,MAAM,6CAA6C,CAAC;AAMrD,OAAO,KAAK,EACX,WAAW,EACX,0BAA0B,EAC1B,qBAAqB,EAErB,SAAS,EACT,sBAAsB,EACtB,sBAAsB,EACtB,8BAA8B,EAC9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ElC,iBAAiB,EAAE,CACnC,OAAO,EAAE,sBAAsB,KAC3B,OAAO,CAAC,WAAW,CAAC;IAK1B,IAAW,sBAAsB,IAAI,wBAAwB,CAE5D;IAEY,oBAAoB,CAChC,OAAO,EAAE,sBAAsB,EAC/B,SAAS,EAAE,OAAO,GAChB,OAAO,CAAC,sBAAsB,CAAC;CA6BlC"}
@@ -308,9 +308,27 @@ export class ChannelCollection {
308
308
  this.pendingAttach.delete(attachMessage.id);
309
309
  continue;
310
310
  }
311
- // If a non-local operation then go and create the object, otherwise mark it as officially attached.
311
+ // Check for collision with local (not yet live / known to other clients) DataStore
312
+ // This is not a DataCorruption case if we crash the container before the DataStore becomes visible to others (it's a DataProcessingError instead)
313
+ //
314
+ // POSSIBLE CAUSES:
315
+ // - Something with ID creation, e.g. a bug in shortID logic, or somehow a generated ID matches an existing alias.
316
+ // - An invalid operation by the application or service where an existing container is returned to a new container attach call,
317
+ // resulting in duplicate accounting for objects that were supposed to be local-only. e.g. if the application patches in custom
318
+ // logic not supported by Fluid's API.
319
+ if (this.contexts.getUnbound(attachMessage.id) !== undefined) {
320
+ const error = DataProcessingError.create("Local DataStore matches remote DataStore id", "DataStoreAttach", envelope, { ...tagCodeArtifacts({ dataStoreId: attachMessage.id }) });
321
+ throw error;
322
+ }
323
+ // Check for collision with already processed (attaching/attached or aliased) DataStore
324
+ // This is presumed to indicate a corrupted op stream, where we'd expect all future sessions to fail here too.
325
+ //
326
+ // POSSIBLE CAUSES:
327
+ // - A bug in the service or driver that results in ops being duplicated
328
+ // - Similar to above, an existing container being returned to a new container attach call,
329
+ // where the DataStore in question was already made locally visible before container attach.
330
+ // (Perhaps future sessions would not fail in this case, but it's hypothetical and hard to differentiate)
312
331
  if (this.alreadyProcessed(attachMessage.id)) {
313
- // TODO: dataStoreId may require a different tag from PackageData #7488
314
332
  const error = new DataCorruptionError(
315
333
  // pre-0.58 error message: duplicateDataStoreCreatedWithExistingId
316
334
  "Duplicate DataStore created with existing id", {