@fluidframework/container-runtime 2.0.0-rc.5.0.0 → 2.0.0-rc.5.0.2
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/container-runtime.test-files.tar +0 -0
- package/dist/channelCollection.d.ts.map +1 -1
- package/dist/channelCollection.js +22 -13
- package/dist/channelCollection.js.map +1 -1
- package/dist/packageVersion.d.ts +1 -1
- package/dist/packageVersion.js +1 -1
- package/dist/packageVersion.js.map +1 -1
- package/lib/channelCollection.d.ts.map +1 -1
- package/lib/channelCollection.js +22 -13
- package/lib/channelCollection.js.map +1 -1
- package/lib/packageVersion.d.ts +1 -1
- package/lib/packageVersion.js +1 -1
- package/lib/packageVersion.js.map +1 -1
- package/package.json +17 -17
- package/src/channelCollection.ts +22 -13
- package/src/packageVersion.ts +1 -1
package/src/channelCollection.ts
CHANGED
|
@@ -70,6 +70,7 @@ import {
|
|
|
70
70
|
extractSafePropertiesFromMessage,
|
|
71
71
|
tagCodeArtifacts,
|
|
72
72
|
} from "@fluidframework/telemetry-utils/internal";
|
|
73
|
+
import { v4 as uuid } from "uuid";
|
|
73
74
|
|
|
74
75
|
import {
|
|
75
76
|
DeletedResponseHeaderKey,
|
|
@@ -610,20 +611,28 @@ export class ChannelCollection implements IFluidDataStoreChannel, IDisposable {
|
|
|
610
611
|
* Please note that above mentioned functions have the implementation they have (allowing #2) due to #1.
|
|
611
612
|
*/
|
|
612
613
|
protected createDataStoreId(): string {
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
if (this.
|
|
619
|
-
//
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
614
|
+
/**
|
|
615
|
+
* There is currently a bug where certain data store ids such as "[" are getting converted to ASCII characters
|
|
616
|
+
* in the snapshot.
|
|
617
|
+
* So, return short ids only if explicitly enabled via feature flags. Else, return uuid();
|
|
618
|
+
*/
|
|
619
|
+
if (this.mc.config.getBoolean("Fluid.Runtime.UseShortIds") === true) {
|
|
620
|
+
// We use three non-overlapping namespaces:
|
|
621
|
+
// - detached state: even numbers
|
|
622
|
+
// - attached state: odd numbers
|
|
623
|
+
// - uuids
|
|
624
|
+
// In first two cases we will encode result as strings in more compact form.
|
|
625
|
+
if (this.parentContext.attachState === AttachState.Detached) {
|
|
626
|
+
// container is detached, only one client observes content, no way to hit collisions with other clients.
|
|
627
|
+
return encodeCompactIdToString(2 * this.contexts.size);
|
|
628
|
+
}
|
|
629
|
+
const id = this.parentContext.containerRuntime.generateDocumentUniqueId();
|
|
630
|
+
if (typeof id === "number") {
|
|
631
|
+
return encodeCompactIdToString(2 * id + 1);
|
|
632
|
+
}
|
|
633
|
+
return id;
|
|
625
634
|
}
|
|
626
|
-
return
|
|
635
|
+
return uuid();
|
|
627
636
|
}
|
|
628
637
|
|
|
629
638
|
public createDetachedDataStore(
|
package/src/packageVersion.ts
CHANGED