@fluidframework/datastore 2.0.0-rc.3.0.0 → 2.0.0-rc.3.0.10
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/dataStoreRuntime.d.ts.map +1 -1
- package/dist/dataStoreRuntime.js +42 -19
- package/dist/dataStoreRuntime.js.map +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/lib/dataStoreRuntime.d.ts.map +1 -1
- package/lib/dataStoreRuntime.js +43 -20
- package/lib/dataStoreRuntime.js.map +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/package.json +17 -17
- package/src/dataStoreRuntime.ts +45 -21
- package/src/packageVersion.ts +1 -1
- package/dist/public.d.ts +0 -12
- package/lib/public.d.ts +0 -12
package/src/dataStoreRuntime.ts
CHANGED
|
@@ -61,11 +61,11 @@ import {
|
|
|
61
61
|
convertSummaryTreeToITree,
|
|
62
62
|
create404Response,
|
|
63
63
|
createResponseError,
|
|
64
|
-
encodeCompactIdToString,
|
|
65
64
|
exceptionToResponse,
|
|
66
65
|
generateHandleContextPath,
|
|
67
66
|
processAttachMessageGCData,
|
|
68
67
|
unpackChildNodesUsedRoutes,
|
|
68
|
+
encodeCompactIdToString,
|
|
69
69
|
} from "@fluidframework/runtime-utils/internal";
|
|
70
70
|
import { ITelemetryLoggerExt } from "@fluidframework/telemetry-utils";
|
|
71
71
|
import {
|
|
@@ -451,21 +451,31 @@ export class FluidDataStoreRuntime
|
|
|
451
451
|
id = idArg;
|
|
452
452
|
this.validateChannelId(id);
|
|
453
453
|
} else {
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
//
|
|
462
|
-
|
|
454
|
+
/**
|
|
455
|
+
* There is currently a bug where certain data store ids such as "[" are getting converted to ASCII characters
|
|
456
|
+
* in the snapshot.
|
|
457
|
+
* So, return short ids only if explicitly enabled via feature flags. Else, return uuid();
|
|
458
|
+
*/
|
|
459
|
+
if (this.mc.config.getBoolean("Fluid.Runtime.UseShortIds") === true) {
|
|
460
|
+
// We use three non-overlapping namespaces:
|
|
461
|
+
// - detached state: even numbers
|
|
462
|
+
// - attached state: odd numbers
|
|
463
|
+
// - uuids
|
|
464
|
+
// In first two cases we will encode result as strings in more compact form, with leading underscore,
|
|
465
|
+
// to ensure no overlap with user-provided DDS names (see validateChannelId())
|
|
466
|
+
if (this.visibilityState !== VisibilityState.GloballyVisible) {
|
|
467
|
+
// container is detached, only one client observes content, no way to hit collisions with other clients.
|
|
468
|
+
id = encodeCompactIdToString(2 * this.contexts.size, "_");
|
|
469
|
+
} else {
|
|
470
|
+
// Due to back-compat, we could not depend yet on generateDocumentUniqueId() being there.
|
|
471
|
+
// We can remove the need to leverage uuid() as fall-back in couple releases.
|
|
472
|
+
const res =
|
|
473
|
+
this.dataStoreContext.containerRuntime.generateDocumentUniqueId?.() ??
|
|
474
|
+
uuid();
|
|
475
|
+
id = typeof res === "number" ? encodeCompactIdToString(2 * res + 1, "_") : res;
|
|
476
|
+
}
|
|
463
477
|
} else {
|
|
464
|
-
|
|
465
|
-
// We can remove the need to leverage uuid() as fall-back in couple releases.
|
|
466
|
-
const res =
|
|
467
|
-
this.dataStoreContext.containerRuntime.generateDocumentUniqueId?.() ?? uuid();
|
|
468
|
-
id = typeof res === "number" ? encodeCompactIdToString(2 * res + 1, "_") : res;
|
|
478
|
+
id = uuid();
|
|
469
479
|
}
|
|
470
480
|
assert(!id.includes("/"), 0x8fc /* slash */);
|
|
471
481
|
}
|
|
@@ -952,13 +962,27 @@ export class FluidDataStoreRuntime
|
|
|
952
962
|
// "The data store should be locally visible when generating attach summary",
|
|
953
963
|
// );
|
|
954
964
|
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
965
|
+
const visitedContexts = new Set<string>();
|
|
966
|
+
let visitedLength = -1;
|
|
967
|
+
while (visitedLength !== visitedContexts.size) {
|
|
968
|
+
// detect changes in the visitedContexts set, as on visiting a context
|
|
969
|
+
// it could could make contexts available by removing other contexts
|
|
970
|
+
// from the notBoundedChannelContextSet, so we need to ensure those get processed as well.
|
|
971
|
+
// only once the loop can run with no new contexts added to the visitedContexts set do we
|
|
972
|
+
// know for sure all possible contexts have been visited.
|
|
973
|
+
visitedLength = visitedContexts.size;
|
|
974
|
+
for (const [contextId, context] of this.contexts) {
|
|
975
|
+
if (!(context instanceof LocalChannelContextBase)) {
|
|
976
|
+
throw new LoggingError("Should only be called with local channel handles");
|
|
977
|
+
}
|
|
959
978
|
|
|
960
|
-
|
|
961
|
-
|
|
979
|
+
if (
|
|
980
|
+
!visitedContexts.has(contextId) &&
|
|
981
|
+
!this.notBoundedChannelContextSet.has(contextId)
|
|
982
|
+
) {
|
|
983
|
+
visitor(contextId, context);
|
|
984
|
+
visitedContexts.add(contextId);
|
|
985
|
+
}
|
|
962
986
|
}
|
|
963
987
|
}
|
|
964
988
|
}
|
package/src/packageVersion.ts
CHANGED
package/dist/public.d.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
-
* Licensed under the MIT License.
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
/*
|
|
7
|
-
* THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
|
|
8
|
-
* Generated by "flub generate entrypoints" in @fluidframework/build-tools.
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
export {}
|
|
12
|
-
|
package/lib/public.d.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
-
* Licensed under the MIT License.
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
/*
|
|
7
|
-
* THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
|
|
8
|
-
* Generated by "flub generate entrypoints" in @fluidframework/build-tools.
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
export {}
|
|
12
|
-
|