@fluidframework/container-runtime 2.0.0-rc.2.0.7 → 2.0.0-rc.2.0.9
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/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 +16 -16
- package/src/channelCollection.ts +22 -13
- package/src/packageVersion.ts +1 -1
package/src/channelCollection.ts
CHANGED
|
@@ -60,6 +60,7 @@ import {
|
|
|
60
60
|
import { AttachState } from "@fluidframework/container-definitions";
|
|
61
61
|
import { buildSnapshotTree } from "@fluidframework/driver-utils";
|
|
62
62
|
import { assert, Lazy, LazyPromise } from "@fluidframework/core-utils";
|
|
63
|
+
import { v4 as uuid } from "uuid";
|
|
63
64
|
import { DataStoreContexts } from "./dataStoreContexts.js";
|
|
64
65
|
import {
|
|
65
66
|
DeletedResponseHeaderKey,
|
|
@@ -587,20 +588,28 @@ export class ChannelCollection implements IFluidDataStoreChannel, IDisposable {
|
|
|
587
588
|
* Please note that above mentioned functions have the implementation they have (allowing #2) due to #1.
|
|
588
589
|
*/
|
|
589
590
|
protected createDataStoreId(): string {
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
if (this.
|
|
596
|
-
//
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
591
|
+
/**
|
|
592
|
+
* There is currently a bug where certain data store ids such as "[" are getting converted to ASCII characters
|
|
593
|
+
* in the snapshot.
|
|
594
|
+
* So, return short ids only if explicitly enabled via feature flags. Else, return uuid();
|
|
595
|
+
*/
|
|
596
|
+
if (this.mc.config.getBoolean("Fluid.Runtime.UseShortIds") === true) {
|
|
597
|
+
// We use three non-overlapping namespaces:
|
|
598
|
+
// - detached state: even numbers
|
|
599
|
+
// - attached state: odd numbers
|
|
600
|
+
// - uuids
|
|
601
|
+
// In first two cases we will encode result as strings in more compact form.
|
|
602
|
+
if (this.parentContext.attachState === AttachState.Detached) {
|
|
603
|
+
// container is detached, only one client observes content, no way to hit collisions with other clients.
|
|
604
|
+
return encodeCompactIdToString(2 * this.contexts.size);
|
|
605
|
+
}
|
|
606
|
+
const id = this.parentContext.containerRuntime.generateDocumentUniqueId();
|
|
607
|
+
if (typeof id === "number") {
|
|
608
|
+
return encodeCompactIdToString(2 * id + 1);
|
|
609
|
+
}
|
|
610
|
+
return id;
|
|
602
611
|
}
|
|
603
|
-
return
|
|
612
|
+
return uuid();
|
|
604
613
|
}
|
|
605
614
|
|
|
606
615
|
public createDetachedDataStoreCore(
|
package/src/packageVersion.ts
CHANGED