@fluidframework/odsp-driver 2.70.0-360374 → 2.70.0-361092
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/createFile/index.d.ts.map +1 -1
- package/dist/createFile/index.js +37 -9
- package/dist/createFile/index.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/createFile/index.d.ts.map +1 -1
- package/lib/createFile/index.js +37 -9
- package/lib/createFile/index.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 +14 -14
- package/src/createFile/index.ts +46 -9
- package/src/packageVersion.ts +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/createFile/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,0CAA0C,CAAC;AAEpF,wBAAsB,kBAAkB,CAAC,CAAC,GAAG,IAAI,EAChD,UAAU,EAAE,mBAAmB,EAC/B,IAAI,EAAE,CAEL,CAAC,EAAE,cAAc,sBAAsB,CAAC,KACpC,OAAO,CAAC,CAAC,CAAC,GACb,OAAO,CAAC,CAAC,CAAC,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/createFile/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,0CAA0C,CAAC;AAEpF,wBAAsB,kBAAkB,CAAC,CAAC,GAAG,IAAI,EAChD,UAAU,EAAE,mBAAmB,EAC/B,IAAI,EAAE,CAEL,CAAC,EAAE,cAAc,sBAAsB,CAAC,KACpC,OAAO,CAAC,CAAC,CAAC,GACb,OAAO,CAAC,CAAC,CAAC,CAoDZ"}
|
package/dist/createFile/index.js
CHANGED
|
@@ -9,15 +9,43 @@ async function useCreateNewModule(odspLogger, func) {
|
|
|
9
9
|
// We can delay load this module as this path will not be executed in load flows and create flow
|
|
10
10
|
// while only happens once in lifetime of a document which happens in the background after creation of
|
|
11
11
|
// detached container.
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
12
|
+
const maxRetries = 3;
|
|
13
|
+
const retryDelayMs = 50; // 50 ms delay between retries
|
|
14
|
+
// eslint-disable-next-line @typescript-eslint/consistent-type-imports
|
|
15
|
+
let module;
|
|
16
|
+
let lastError;
|
|
17
|
+
for (let attempt = 1; attempt <= maxRetries; attempt++) {
|
|
18
|
+
// Add delay before retry attempts (not on first attempt)
|
|
19
|
+
if (attempt > 1) {
|
|
20
|
+
await new Promise((resolve) => setTimeout(resolve, retryDelayMs));
|
|
21
|
+
}
|
|
22
|
+
module = await import(/* webpackChunkName: "createNewModule" */ "./createNewModule.js")
|
|
23
|
+
.then((m) => {
|
|
24
|
+
odspLogger.sendTelemetryEvent({ eventName: "createNewModuleLoaded", attempt });
|
|
25
|
+
return m;
|
|
26
|
+
})
|
|
27
|
+
.catch((error) => {
|
|
28
|
+
lastError = error;
|
|
29
|
+
odspLogger.sendTelemetryEvent({
|
|
30
|
+
eventName: "createNewModuleImportRetry",
|
|
31
|
+
attempt,
|
|
32
|
+
maxRetries,
|
|
33
|
+
}, error);
|
|
34
|
+
return undefined;
|
|
35
|
+
});
|
|
36
|
+
// If successfully loaded the module, break out of the loop and use it
|
|
37
|
+
if (module) {
|
|
38
|
+
break;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
if (!module) {
|
|
42
|
+
// Final attempt failed
|
|
43
|
+
odspLogger.sendErrorEvent({
|
|
44
|
+
eventName: "createNewModuleLoadFailed",
|
|
45
|
+
maxRetries,
|
|
46
|
+
}, lastError);
|
|
47
|
+
throw lastError;
|
|
48
|
+
}
|
|
21
49
|
return func(module);
|
|
22
50
|
}
|
|
23
51
|
exports.useCreateNewModule = useCreateNewModule;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/createFile/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAII,KAAK,UAAU,kBAAkB,CACvC,UAA+B,EAC/B,IAGe;IAEf,gGAAgG;IAChG,sGAAsG;IACtG,sBAAsB;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/createFile/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAII,KAAK,UAAU,kBAAkB,CACvC,UAA+B,EAC/B,IAGe;IAEf,gGAAgG;IAChG,sGAAsG;IACtG,sBAAsB;IAEtB,MAAM,UAAU,GAAG,CAAC,CAAC;IACrB,MAAM,YAAY,GAAG,EAAE,CAAC,CAAC,8BAA8B;IACvD,sEAAsE;IACtE,IAAI,MAAyD,CAAC;IAC9D,IAAI,SAAkB,CAAC;IAEvB,KAAK,IAAI,OAAO,GAAG,CAAC,EAAE,OAAO,IAAI,UAAU,EAAE,OAAO,EAAE,EAAE,CAAC;QACxD,yDAAyD;QACzD,IAAI,OAAO,GAAG,CAAC,EAAE,CAAC;YACjB,MAAM,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,YAAY,CAAC,CAAC,CAAC;QACnE,CAAC;QACD,MAAM,GAAG,MAAM,MAAM,CAAC,yCAAyC,CAAC,sBAAsB,CAAC;aACrF,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE;YACX,UAAU,CAAC,kBAAkB,CAAC,EAAE,SAAS,EAAE,uBAAuB,EAAE,OAAO,EAAE,CAAC,CAAC;YAC/E,OAAO,CAAC,CAAC;QACV,CAAC,CAAC;aACD,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;YAChB,SAAS,GAAG,KAAK,CAAC;YAClB,UAAU,CAAC,kBAAkB,CAC5B;gBACC,SAAS,EAAE,4BAA4B;gBACvC,OAAO;gBACP,UAAU;aACV,EACD,KAAK,CACL,CAAC;YACF,OAAO,SAAS,CAAC;QAClB,CAAC,CAAC,CAAC;QACJ,sEAAsE;QACtE,IAAI,MAAM,EAAE,CAAC;YACZ,MAAM;QACP,CAAC;IACF,CAAC;IAED,IAAI,CAAC,MAAM,EAAE,CAAC;QACb,uBAAuB;QACvB,UAAU,CAAC,cAAc,CACxB;YACC,SAAS,EAAE,2BAA2B;YACtC,UAAU;SACV,EACD,SAAS,CACT,CAAC;QACF,MAAM,SAAS,CAAC;IACjB,CAAC;IAED,OAAO,IAAI,CAAC,MAAM,CAAC,CAAC;AACrB,CAAC;AA1DD,gDA0DC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { ITelemetryLoggerExt } from \"@fluidframework/telemetry-utils/internal\";\n\nexport async function useCreateNewModule<T = void>(\n\todspLogger: ITelemetryLoggerExt,\n\tfunc: (\n\t\t// eslint-disable-next-line @typescript-eslint/consistent-type-imports\n\t\tm: typeof import(\"./createNewModule.js\") /* webpackChunkName: \"createNewModule\" */,\n\t) => Promise<T>,\n): Promise<T> {\n\t// We can delay load this module as this path will not be executed in load flows and create flow\n\t// while only happens once in lifetime of a document which happens in the background after creation of\n\t// detached container.\n\n\tconst maxRetries = 3;\n\tconst retryDelayMs = 50; // 50 ms delay between retries\n\t// eslint-disable-next-line @typescript-eslint/consistent-type-imports\n\tlet module: typeof import(\"./createNewModule.js\") | undefined;\n\tlet lastError: unknown;\n\n\tfor (let attempt = 1; attempt <= maxRetries; attempt++) {\n\t\t// Add delay before retry attempts (not on first attempt)\n\t\tif (attempt > 1) {\n\t\t\tawait new Promise((resolve) => setTimeout(resolve, retryDelayMs));\n\t\t}\n\t\tmodule = await import(/* webpackChunkName: \"createNewModule\" */ \"./createNewModule.js\")\n\t\t\t.then((m) => {\n\t\t\t\todspLogger.sendTelemetryEvent({ eventName: \"createNewModuleLoaded\", attempt });\n\t\t\t\treturn m;\n\t\t\t})\n\t\t\t.catch((error) => {\n\t\t\t\tlastError = error;\n\t\t\t\todspLogger.sendTelemetryEvent(\n\t\t\t\t\t{\n\t\t\t\t\t\teventName: \"createNewModuleImportRetry\",\n\t\t\t\t\t\tattempt,\n\t\t\t\t\t\tmaxRetries,\n\t\t\t\t\t},\n\t\t\t\t\terror,\n\t\t\t\t);\n\t\t\t\treturn undefined;\n\t\t\t});\n\t\t// If successfully loaded the module, break out of the loop and use it\n\t\tif (module) {\n\t\t\tbreak;\n\t\t}\n\t}\n\n\tif (!module) {\n\t\t// Final attempt failed\n\t\todspLogger.sendErrorEvent(\n\t\t\t{\n\t\t\t\teventName: \"createNewModuleLoadFailed\",\n\t\t\t\tmaxRetries,\n\t\t\t},\n\t\t\tlastError,\n\t\t);\n\t\tthrow lastError;\n\t}\n\n\treturn func(module);\n}\n"]}
|
package/dist/packageVersion.d.ts
CHANGED
|
@@ -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/odsp-driver";
|
|
8
|
-
export declare const pkgVersion = "2.70.0-
|
|
8
|
+
export declare const pkgVersion = "2.70.0-361092";
|
|
9
9
|
//# sourceMappingURL=packageVersion.d.ts.map
|
package/dist/packageVersion.js
CHANGED
|
@@ -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/odsp-driver";
|
|
11
|
-
exports.pkgVersion = "2.70.0-
|
|
11
|
+
exports.pkgVersion = "2.70.0-361092";
|
|
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,6BAA6B,CAAC;AACxC,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/odsp-driver\";\nexport const pkgVersion = \"2.70.0-
|
|
1
|
+
{"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEU,QAAA,OAAO,GAAG,6BAA6B,CAAC;AACxC,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/odsp-driver\";\nexport const pkgVersion = \"2.70.0-361092\";\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/createFile/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,0CAA0C,CAAC;AAEpF,wBAAsB,kBAAkB,CAAC,CAAC,GAAG,IAAI,EAChD,UAAU,EAAE,mBAAmB,EAC/B,IAAI,EAAE,CAEL,CAAC,EAAE,cAAc,sBAAsB,CAAC,KACpC,OAAO,CAAC,CAAC,CAAC,GACb,OAAO,CAAC,CAAC,CAAC,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/createFile/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,0CAA0C,CAAC;AAEpF,wBAAsB,kBAAkB,CAAC,CAAC,GAAG,IAAI,EAChD,UAAU,EAAE,mBAAmB,EAC/B,IAAI,EAAE,CAEL,CAAC,EAAE,cAAc,sBAAsB,CAAC,KACpC,OAAO,CAAC,CAAC,CAAC,GACb,OAAO,CAAC,CAAC,CAAC,CAoDZ"}
|
package/lib/createFile/index.js
CHANGED
|
@@ -6,15 +6,43 @@ export async function useCreateNewModule(odspLogger, func) {
|
|
|
6
6
|
// We can delay load this module as this path will not be executed in load flows and create flow
|
|
7
7
|
// while only happens once in lifetime of a document which happens in the background after creation of
|
|
8
8
|
// detached container.
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
9
|
+
const maxRetries = 3;
|
|
10
|
+
const retryDelayMs = 50; // 50 ms delay between retries
|
|
11
|
+
// eslint-disable-next-line @typescript-eslint/consistent-type-imports
|
|
12
|
+
let module;
|
|
13
|
+
let lastError;
|
|
14
|
+
for (let attempt = 1; attempt <= maxRetries; attempt++) {
|
|
15
|
+
// Add delay before retry attempts (not on first attempt)
|
|
16
|
+
if (attempt > 1) {
|
|
17
|
+
await new Promise((resolve) => setTimeout(resolve, retryDelayMs));
|
|
18
|
+
}
|
|
19
|
+
module = await import(/* webpackChunkName: "createNewModule" */ "./createNewModule.js")
|
|
20
|
+
.then((m) => {
|
|
21
|
+
odspLogger.sendTelemetryEvent({ eventName: "createNewModuleLoaded", attempt });
|
|
22
|
+
return m;
|
|
23
|
+
})
|
|
24
|
+
.catch((error) => {
|
|
25
|
+
lastError = error;
|
|
26
|
+
odspLogger.sendTelemetryEvent({
|
|
27
|
+
eventName: "createNewModuleImportRetry",
|
|
28
|
+
attempt,
|
|
29
|
+
maxRetries,
|
|
30
|
+
}, error);
|
|
31
|
+
return undefined;
|
|
32
|
+
});
|
|
33
|
+
// If successfully loaded the module, break out of the loop and use it
|
|
34
|
+
if (module) {
|
|
35
|
+
break;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
if (!module) {
|
|
39
|
+
// Final attempt failed
|
|
40
|
+
odspLogger.sendErrorEvent({
|
|
41
|
+
eventName: "createNewModuleLoadFailed",
|
|
42
|
+
maxRetries,
|
|
43
|
+
}, lastError);
|
|
44
|
+
throw lastError;
|
|
45
|
+
}
|
|
18
46
|
return func(module);
|
|
19
47
|
}
|
|
20
48
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/createFile/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,MAAM,CAAC,KAAK,UAAU,kBAAkB,CACvC,UAA+B,EAC/B,IAGe;IAEf,gGAAgG;IAChG,sGAAsG;IACtG,sBAAsB;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/createFile/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,MAAM,CAAC,KAAK,UAAU,kBAAkB,CACvC,UAA+B,EAC/B,IAGe;IAEf,gGAAgG;IAChG,sGAAsG;IACtG,sBAAsB;IAEtB,MAAM,UAAU,GAAG,CAAC,CAAC;IACrB,MAAM,YAAY,GAAG,EAAE,CAAC,CAAC,8BAA8B;IACvD,sEAAsE;IACtE,IAAI,MAAyD,CAAC;IAC9D,IAAI,SAAkB,CAAC;IAEvB,KAAK,IAAI,OAAO,GAAG,CAAC,EAAE,OAAO,IAAI,UAAU,EAAE,OAAO,EAAE,EAAE,CAAC;QACxD,yDAAyD;QACzD,IAAI,OAAO,GAAG,CAAC,EAAE,CAAC;YACjB,MAAM,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,YAAY,CAAC,CAAC,CAAC;QACnE,CAAC;QACD,MAAM,GAAG,MAAM,MAAM,CAAC,yCAAyC,CAAC,sBAAsB,CAAC;aACrF,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE;YACX,UAAU,CAAC,kBAAkB,CAAC,EAAE,SAAS,EAAE,uBAAuB,EAAE,OAAO,EAAE,CAAC,CAAC;YAC/E,OAAO,CAAC,CAAC;QACV,CAAC,CAAC;aACD,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;YAChB,SAAS,GAAG,KAAK,CAAC;YAClB,UAAU,CAAC,kBAAkB,CAC5B;gBACC,SAAS,EAAE,4BAA4B;gBACvC,OAAO;gBACP,UAAU;aACV,EACD,KAAK,CACL,CAAC;YACF,OAAO,SAAS,CAAC;QAClB,CAAC,CAAC,CAAC;QACJ,sEAAsE;QACtE,IAAI,MAAM,EAAE,CAAC;YACZ,MAAM;QACP,CAAC;IACF,CAAC;IAED,IAAI,CAAC,MAAM,EAAE,CAAC;QACb,uBAAuB;QACvB,UAAU,CAAC,cAAc,CACxB;YACC,SAAS,EAAE,2BAA2B;YACtC,UAAU;SACV,EACD,SAAS,CACT,CAAC;QACF,MAAM,SAAS,CAAC;IACjB,CAAC;IAED,OAAO,IAAI,CAAC,MAAM,CAAC,CAAC;AACrB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { ITelemetryLoggerExt } from \"@fluidframework/telemetry-utils/internal\";\n\nexport async function useCreateNewModule<T = void>(\n\todspLogger: ITelemetryLoggerExt,\n\tfunc: (\n\t\t// eslint-disable-next-line @typescript-eslint/consistent-type-imports\n\t\tm: typeof import(\"./createNewModule.js\") /* webpackChunkName: \"createNewModule\" */,\n\t) => Promise<T>,\n): Promise<T> {\n\t// We can delay load this module as this path will not be executed in load flows and create flow\n\t// while only happens once in lifetime of a document which happens in the background after creation of\n\t// detached container.\n\n\tconst maxRetries = 3;\n\tconst retryDelayMs = 50; // 50 ms delay between retries\n\t// eslint-disable-next-line @typescript-eslint/consistent-type-imports\n\tlet module: typeof import(\"./createNewModule.js\") | undefined;\n\tlet lastError: unknown;\n\n\tfor (let attempt = 1; attempt <= maxRetries; attempt++) {\n\t\t// Add delay before retry attempts (not on first attempt)\n\t\tif (attempt > 1) {\n\t\t\tawait new Promise((resolve) => setTimeout(resolve, retryDelayMs));\n\t\t}\n\t\tmodule = await import(/* webpackChunkName: \"createNewModule\" */ \"./createNewModule.js\")\n\t\t\t.then((m) => {\n\t\t\t\todspLogger.sendTelemetryEvent({ eventName: \"createNewModuleLoaded\", attempt });\n\t\t\t\treturn m;\n\t\t\t})\n\t\t\t.catch((error) => {\n\t\t\t\tlastError = error;\n\t\t\t\todspLogger.sendTelemetryEvent(\n\t\t\t\t\t{\n\t\t\t\t\t\teventName: \"createNewModuleImportRetry\",\n\t\t\t\t\t\tattempt,\n\t\t\t\t\t\tmaxRetries,\n\t\t\t\t\t},\n\t\t\t\t\terror,\n\t\t\t\t);\n\t\t\t\treturn undefined;\n\t\t\t});\n\t\t// If successfully loaded the module, break out of the loop and use it\n\t\tif (module) {\n\t\t\tbreak;\n\t\t}\n\t}\n\n\tif (!module) {\n\t\t// Final attempt failed\n\t\todspLogger.sendErrorEvent(\n\t\t\t{\n\t\t\t\teventName: \"createNewModuleLoadFailed\",\n\t\t\t\tmaxRetries,\n\t\t\t},\n\t\t\tlastError,\n\t\t);\n\t\tthrow lastError;\n\t}\n\n\treturn func(module);\n}\n"]}
|
package/lib/packageVersion.d.ts
CHANGED
|
@@ -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/odsp-driver";
|
|
8
|
-
export declare const pkgVersion = "2.70.0-
|
|
8
|
+
export declare const pkgVersion = "2.70.0-361092";
|
|
9
9
|
//# sourceMappingURL=packageVersion.d.ts.map
|
package/lib/packageVersion.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,CAAC,MAAM,OAAO,GAAG,6BAA6B,CAAC;AACrD,MAAM,CAAC,MAAM,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/odsp-driver\";\nexport const pkgVersion = \"2.70.0-
|
|
1
|
+
{"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,CAAC,MAAM,OAAO,GAAG,6BAA6B,CAAC;AACrD,MAAM,CAAC,MAAM,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/odsp-driver\";\nexport const pkgVersion = \"2.70.0-361092\";\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluidframework/odsp-driver",
|
|
3
|
-
"version": "2.70.0-
|
|
3
|
+
"version": "2.70.0-361092",
|
|
4
4
|
"description": "Socket storage implementation for SPO and ODC",
|
|
5
5
|
"homepage": "https://fluidframework.com",
|
|
6
6
|
"repository": {
|
|
@@ -69,27 +69,27 @@
|
|
|
69
69
|
"temp-directory": "nyc/.nyc_output"
|
|
70
70
|
},
|
|
71
71
|
"dependencies": {
|
|
72
|
-
"@fluid-internal/client-utils": "2.70.0-
|
|
73
|
-
"@fluidframework/core-interfaces": "2.70.0-
|
|
74
|
-
"@fluidframework/core-utils": "2.70.0-
|
|
75
|
-
"@fluidframework/driver-base": "2.70.0-
|
|
76
|
-
"@fluidframework/driver-definitions": "2.70.0-
|
|
77
|
-
"@fluidframework/driver-utils": "2.70.0-
|
|
78
|
-
"@fluidframework/odsp-doclib-utils": "2.70.0-
|
|
79
|
-
"@fluidframework/odsp-driver-definitions": "2.70.0-
|
|
80
|
-
"@fluidframework/telemetry-utils": "2.70.0-
|
|
72
|
+
"@fluid-internal/client-utils": "2.70.0-361092",
|
|
73
|
+
"@fluidframework/core-interfaces": "2.70.0-361092",
|
|
74
|
+
"@fluidframework/core-utils": "2.70.0-361092",
|
|
75
|
+
"@fluidframework/driver-base": "2.70.0-361092",
|
|
76
|
+
"@fluidframework/driver-definitions": "2.70.0-361092",
|
|
77
|
+
"@fluidframework/driver-utils": "2.70.0-361092",
|
|
78
|
+
"@fluidframework/odsp-doclib-utils": "2.70.0-361092",
|
|
79
|
+
"@fluidframework/odsp-driver-definitions": "2.70.0-361092",
|
|
80
|
+
"@fluidframework/telemetry-utils": "2.70.0-361092",
|
|
81
81
|
"socket.io-client": "~4.7.5",
|
|
82
82
|
"uuid": "^11.1.0"
|
|
83
83
|
},
|
|
84
84
|
"devDependencies": {
|
|
85
85
|
"@arethetypeswrong/cli": "^0.17.1",
|
|
86
86
|
"@biomejs/biome": "~1.9.3",
|
|
87
|
-
"@fluid-internal/mocha-test-setup": "2.70.0-
|
|
87
|
+
"@fluid-internal/mocha-test-setup": "2.70.0-361092",
|
|
88
88
|
"@fluid-tools/build-cli": "^0.58.3",
|
|
89
89
|
"@fluidframework/build-common": "^2.0.3",
|
|
90
90
|
"@fluidframework/build-tools": "^0.58.3",
|
|
91
|
-
"@fluidframework/eslint-config-fluid": "^6.
|
|
92
|
-
"@fluidframework/odsp-driver-previous": "npm:@fluidframework/odsp-driver@2.
|
|
91
|
+
"@fluidframework/eslint-config-fluid": "^6.1.0",
|
|
92
|
+
"@fluidframework/odsp-driver-previous": "npm:@fluidframework/odsp-driver@2.63.0",
|
|
93
93
|
"@microsoft/api-extractor": "7.52.11",
|
|
94
94
|
"@types/mocha": "^10.0.10",
|
|
95
95
|
"@types/node": "^18.19.0",
|
|
@@ -98,7 +98,7 @@
|
|
|
98
98
|
"concurrently": "^8.2.1",
|
|
99
99
|
"copyfiles": "^2.4.1",
|
|
100
100
|
"cross-env": "^7.0.3",
|
|
101
|
-
"eslint": "~8.
|
|
101
|
+
"eslint": "~8.57.1",
|
|
102
102
|
"mocha": "^10.8.2",
|
|
103
103
|
"mocha-multi-reporters": "^1.5.1",
|
|
104
104
|
"rimraf": "^4.4.0",
|
package/src/createFile/index.ts
CHANGED
|
@@ -15,15 +15,52 @@ export async function useCreateNewModule<T = void>(
|
|
|
15
15
|
// We can delay load this module as this path will not be executed in load flows and create flow
|
|
16
16
|
// while only happens once in lifetime of a document which happens in the background after creation of
|
|
17
17
|
// detached container.
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
18
|
+
|
|
19
|
+
const maxRetries = 3;
|
|
20
|
+
const retryDelayMs = 50; // 50 ms delay between retries
|
|
21
|
+
// eslint-disable-next-line @typescript-eslint/consistent-type-imports
|
|
22
|
+
let module: typeof import("./createNewModule.js") | undefined;
|
|
23
|
+
let lastError: unknown;
|
|
24
|
+
|
|
25
|
+
for (let attempt = 1; attempt <= maxRetries; attempt++) {
|
|
26
|
+
// Add delay before retry attempts (not on first attempt)
|
|
27
|
+
if (attempt > 1) {
|
|
28
|
+
await new Promise((resolve) => setTimeout(resolve, retryDelayMs));
|
|
29
|
+
}
|
|
30
|
+
module = await import(/* webpackChunkName: "createNewModule" */ "./createNewModule.js")
|
|
31
|
+
.then((m) => {
|
|
32
|
+
odspLogger.sendTelemetryEvent({ eventName: "createNewModuleLoaded", attempt });
|
|
33
|
+
return m;
|
|
34
|
+
})
|
|
35
|
+
.catch((error) => {
|
|
36
|
+
lastError = error;
|
|
37
|
+
odspLogger.sendTelemetryEvent(
|
|
38
|
+
{
|
|
39
|
+
eventName: "createNewModuleImportRetry",
|
|
40
|
+
attempt,
|
|
41
|
+
maxRetries,
|
|
42
|
+
},
|
|
43
|
+
error,
|
|
44
|
+
);
|
|
45
|
+
return undefined;
|
|
46
|
+
});
|
|
47
|
+
// If successfully loaded the module, break out of the loop and use it
|
|
48
|
+
if (module) {
|
|
49
|
+
break;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
if (!module) {
|
|
54
|
+
// Final attempt failed
|
|
55
|
+
odspLogger.sendErrorEvent(
|
|
56
|
+
{
|
|
57
|
+
eventName: "createNewModuleLoadFailed",
|
|
58
|
+
maxRetries,
|
|
59
|
+
},
|
|
60
|
+
lastError,
|
|
61
|
+
);
|
|
62
|
+
throw lastError;
|
|
63
|
+
}
|
|
27
64
|
|
|
28
65
|
return func(module);
|
|
29
66
|
}
|
package/src/packageVersion.ts
CHANGED