@fluidframework/odsp-driver 0.59.4002 → 0.59.4003
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/odspSummaryUploadManager.d.ts.map +1 -1
- package/dist/odspSummaryUploadManager.js +1 -4
- package/dist/odspSummaryUploadManager.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/odspSummaryUploadManager.d.ts.map +1 -1
- package/lib/odspSummaryUploadManager.js +1 -4
- package/lib/odspSummaryUploadManager.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 +9 -9
- package/src/odspSummaryUploadManager.ts +1 -4
- package/src/packageVersion.ts +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"odspSummaryUploadManager.d.ts","sourceRoot":"","sources":["../src/odspSummaryUploadManager.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AAEtE,OAAO,EAAE,eAAe,EAAE,MAAM,oCAAoC,CAAC;AAErE,OAAO,KAAK,GAAG,MAAM,sCAAsC,CAAC;AAC5D,OAAO,EAAE,+BAA+B,EAAE,MAAM,yCAAyC,CAAC;AAU1F,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAM9C;;;GAGG;AACH,qBAAa,wBAAwB;IAM7B,OAAO,CAAC,QAAQ,CAAC,WAAW;IAC5B,OAAO,CAAC,QAAQ,CAAC,eAAe;IAEhC,OAAO,CAAC,QAAQ,CAAC,YAAY;IAC7B,OAAO,CAAC,QAAQ,CAAC,sCAAsC;IAR3D,OAAO,CAAC,yBAAyB,CAAqB;IACtD,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAoB;gBAGlB,WAAW,EAAE,MAAM,EACnB,eAAe,EAAE,+BAA+B,EACjE,MAAM,EAAE,gBAAgB,EACP,YAAY,EAAE,YAAY,EAC1B,sCAAsC,EAAE,OAAO;IAKvD,gBAAgB,CAAC,IAAI,EAAE,GAAG,CAAC,YAAY,EAAE,OAAO,EAAE,eAAe;YAqBhE,oBAAoB;
|
|
1
|
+
{"version":3,"file":"odspSummaryUploadManager.d.ts","sourceRoot":"","sources":["../src/odspSummaryUploadManager.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AAEtE,OAAO,EAAE,eAAe,EAAE,MAAM,oCAAoC,CAAC;AAErE,OAAO,KAAK,GAAG,MAAM,sCAAsC,CAAC;AAC5D,OAAO,EAAE,+BAA+B,EAAE,MAAM,yCAAyC,CAAC;AAU1F,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAM9C;;;GAGG;AACH,qBAAa,wBAAwB;IAM7B,OAAO,CAAC,QAAQ,CAAC,WAAW;IAC5B,OAAO,CAAC,QAAQ,CAAC,eAAe;IAEhC,OAAO,CAAC,QAAQ,CAAC,YAAY;IAC7B,OAAO,CAAC,QAAQ,CAAC,sCAAsC;IAR3D,OAAO,CAAC,yBAAyB,CAAqB;IACtD,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAoB;gBAGlB,WAAW,EAAE,MAAM,EACnB,eAAe,EAAE,+BAA+B,EACjE,MAAM,EAAE,gBAAgB,EACP,YAAY,EAAE,YAAY,EAC1B,sCAAsC,EAAE,OAAO;IAKvD,gBAAgB,CAAC,IAAI,EAAE,GAAG,CAAC,YAAY,EAAE,OAAO,EAAE,eAAe;YAqBhE,oBAAoB;IA6DlC;;;;;;;;OAQG;YACW,4BAA4B;CAoG7C"}
|
|
@@ -64,9 +64,7 @@ class OdspSummaryUploadManager {
|
|
|
64
64
|
return id;
|
|
65
65
|
}
|
|
66
66
|
async writeSummaryTreeCore(parentHandle, referenceSequenceNumber, tree) {
|
|
67
|
-
const
|
|
68
|
-
const containsProtocolTree = enableContainerTypeSummaryUpload &&
|
|
69
|
-
Object.keys(tree.tree).includes(".protocol");
|
|
67
|
+
const containsProtocolTree = Object.keys(tree.tree).includes(".protocol");
|
|
70
68
|
const { snapshotTree, blobs } = await this.convertSummaryToSnapshotTree(parentHandle, tree, ".app");
|
|
71
69
|
const snapshot = {
|
|
72
70
|
entries: snapshotTree.entries,
|
|
@@ -94,7 +92,6 @@ class OdspSummaryUploadManager {
|
|
|
94
92
|
size: postBody.length,
|
|
95
93
|
referenceSequenceNumber,
|
|
96
94
|
type: snapshot.type,
|
|
97
|
-
enableContainerTypeSummaryUpload,
|
|
98
95
|
}, async () => {
|
|
99
96
|
const response = await this.epochTracker.fetchAndParseAsJSON(url, {
|
|
100
97
|
body: postBody,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"odspSummaryUploadManager.js","sourceRoot":"","sources":["../src/odspSummaryUploadManager.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;;;;;;;;;;;;;;;;;AAGH,+DAA2F;AAE3F,iEAA2D;AAC3D,0EAA4D;AAE5D,qEAAiH;AAUjH,yEAAsE;AACtE,2CAA0D;AAE1D,4BAA4B;AAE5B;;;GAGG;AACH,MAAa,wBAAwB;IAKjC,YACqB,WAAmB,EACnB,eAAgD,EACjE,MAAwB,EACP,YAA0B,EAC1B,sCAA+C;QAJ/C,gBAAW,GAAX,WAAW,CAAQ;QACnB,oBAAe,GAAf,eAAe,CAAiC;QAEhD,iBAAY,GAAZ,YAAY,CAAc;QAC1B,2CAAsC,GAAtC,sCAAsC,CAAS;QAEhE,IAAI,CAAC,EAAE,GAAG,IAAA,2CAAyB,EAAC,MAAM,CAAC,CAAC;IAChD,CAAC;IAEM,KAAK,CAAC,gBAAgB,CAAC,IAAsB,EAAE,OAAwB;QAC1E,8HAA8H;QAC9H,gIAAgI;QAChI,6GAA6G;QAC7G,IAAI,IAAI,CAAC,yBAAyB,KAAK,SAAS;YAC5C,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AC7B,IAAI,EAAE,IAAA,0BAAU,EAAC,aAAa,CAAC;aAClC,CAAC;YAEF,IAAI,KAA2B,CAAC;YAEhC,IAAI,KAAK,EAAE;gBACP,IAAA,qBAAM,EAAC,EAAE,KAAK,SAAS,EAAE,KAAK,CAAC,iEAAiE,CAAC,CAAC;gBAClG,KAAK,iCACD,KAAK,IACF,SAAS,KACZ,YAAY,GACf,CAAC;aACL;iBAAM,IAAI,EAAE,EAAE;gBACX,KAAK,mCACE,SAAS,KACZ,EAAE,GACL,CAAC;aACL;iBAAM;gBACH,MAAM,IAAI,KAAK,CAAC,0BAA0B,aAAa,CAAC,IAAI,EAAE,CAAC,CAAC;aACnE;YAED,YAAY,CAAC,OAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;SACrC;QAED,OAAO,EAAE,YAAY,EAAE,KAAK,EAAE,CAAC;IACnC,CAAC;CACJ;AAjND,4DAiNC;AAED,2BAA2B","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { ITelemetryLogger } from \"@fluidframework/common-definitions\";\nimport { assert, Uint8ArrayToString, unreachableCase } from \"@fluidframework/common-utils\";\nimport { ISummaryContext } from \"@fluidframework/driver-definitions\";\nimport { getGitType } from \"@fluidframework/protocol-base\";\nimport * as api from \"@fluidframework/protocol-definitions\";\nimport { InstrumentedStorageTokenFetcher } from \"@fluidframework/odsp-driver-definitions\";\nimport { loggerToMonitoringContext, MonitoringContext, PerformanceEvent } from \"@fluidframework/telemetry-utils\";\nimport {\n IOdspSummaryPayload,\n IWriteSummaryResponse,\n IOdspSummaryTree,\n IOdspSummaryTreeBaseEntry,\n OdspSummaryTreeEntry,\n OdspSummaryTreeValue,\n} from \"./contracts\";\nimport { EpochTracker } from \"./epochTracker\";\nimport { getUrlAndHeadersWithAuth } from \"./getUrlAndHeadersWithAuth\";\nimport { getWithRetryForTokenRefresh } from \"./odspUtils\";\n\n/* eslint-disable max-len */\n\n/**\n * This class manages a summary upload. When it receives a call to upload summary, it converts the summary tree into\n * a snapshot tree and then uploads that to the server.\n */\nexport class OdspSummaryUploadManager {\n // Last proposed handle of the uploaded app summary.\n private lastSummaryProposalHandle: string | undefined;\n private readonly mc: MonitoringContext;\n\n constructor(\n private readonly snapshotUrl: string,\n private readonly getStorageToken: InstrumentedStorageTokenFetcher,\n logger: ITelemetryLogger,\n private readonly epochTracker: EpochTracker,\n private readonly forceAccessTokenViaAuthorizationHeader: boolean,\n ) {\n this.mc = loggerToMonitoringContext(logger);\n }\n\n public async writeSummaryTree(tree: api.ISummaryTree, context: ISummaryContext) {\n // If the last proposed handle is not the proposed handle of the acked summary(could happen when the last summary get nacked),\n // then re-initialize the caches with the previous ones else just update the previous caches with the caches from acked summary.\n // Don't bother logging if lastSummaryProposalHandle hasn't been set before; only log on a positive mismatch.\n if (this.lastSummaryProposalHandle !== undefined &&\n this.lastSummaryProposalHandle !== context.proposalHandle) {\n this.mc.logger.sendTelemetryEvent({\n eventName: \"LastSummaryProposedHandleMismatch\",\n ackedSummaryProposedHandle: context.proposalHandle,\n lastSummaryProposalHandle: this.lastSummaryProposalHandle,\n });\n }\n const result = await this.writeSummaryTreeCore(context.ackHandle, context.referenceSequenceNumber, tree);\n const id = result ? result.id : undefined;\n if (!result || !id) {\n throw new Error(`Failed to write summary tree`);\n }\n this.lastSummaryProposalHandle = id;\n return id;\n }\n\n private async writeSummaryTreeCore(\n parentHandle: string | undefined,\n referenceSequenceNumber: number,\n tree: api.ISummaryTree,\n ): Promise<IWriteSummaryResponse> {\n const enableContainerTypeSummaryUpload = this.mc.config.getBoolean(\"Fluid.Driver.Odsp.EnableContainerTypeSummaryUpload\");\n const containsProtocolTree = enableContainerTypeSummaryUpload &&\n Object.keys(tree.tree).includes(\".protocol\");\n const { snapshotTree, blobs } = await this.convertSummaryToSnapshotTree(\n parentHandle,\n tree,\n \".app\",\n );\n const snapshot: IOdspSummaryPayload = {\n entries: snapshotTree.entries!,\n message: \"app\",\n sequenceNumber: referenceSequenceNumber,\n // no ack handle implies this is initial summary after empty file creation.\n // send container payload so server will use it without a summary op\n type: containsProtocolTree || parentHandle === undefined ? \"container\" : \"channel\",\n };\n\n return getWithRetryForTokenRefresh(async (options) => {\n const storageToken = await this.getStorageToken(options, \"WriteSummaryTree\");\n\n const { url, headers } = getUrlAndHeadersWithAuth(\n `${this.snapshotUrl}/snapshot`,\n storageToken,\n this.forceAccessTokenViaAuthorizationHeader,\n );\n headers[\"Content-Type\"] = \"application/json\";\n if (parentHandle) {\n headers[\"If-Match\"] = `fluid:containerid=${parentHandle}`;\n }\n\n const postBody = JSON.stringify(snapshot);\n\n return PerformanceEvent.timedExecAsync(this.mc.logger,\n {\n eventName: \"uploadSummary\",\n attempt: options.refresh ? 2 : 1,\n hasClaims: !!options.claims,\n hasTenantId: !!options.tenantId,\n headers: Object.keys(headers).length !== 0 ? true : undefined,\n blobs,\n size: postBody.length,\n referenceSequenceNumber,\n type: snapshot.type,\n enableContainerTypeSummaryUpload,\n },\n async () => {\n const response = await this.epochTracker.fetchAndParseAsJSON<IWriteSummaryResponse>(\n url,\n {\n body: postBody,\n headers,\n method: \"POST\",\n },\n \"uploadSummary\");\n return response.content;\n });\n });\n }\n\n /**\n * Following are the goals of this function.\n * a.) Converts the summary tree to a snapshot/odsp tree to be uploaded. Always upload full snapshot tree.\n * @param parentHandle - Handle of the last uploaded summary or detach new summary.\n * @param tree - Summary Tree which will be converted to snapshot tree to be uploaded.\n * @param rootNodeName - Root node name of the summary tree.\n * @param path - Current path of node which is getting evaluated.\n * @param markUnreferencedNodes - True if we should mark unreferenced nodes.\n */\n private async convertSummaryToSnapshotTree(\n parentHandle: string | undefined,\n tree: api.ISummaryTree,\n rootNodeName: string,\n markUnreferencedNodes: boolean = this.mc.config.getBoolean(\"Fluid.Driver.Odsp.MarkUnreferencedNodes\") ?? true,\n ) {\n const snapshotTree: IOdspSummaryTree = {\n type: \"tree\",\n entries: [] as OdspSummaryTreeEntry[],\n };\n\n let blobs = 0;\n const keys = Object.keys(tree.tree);\n for (const key of keys) {\n const summaryObject = tree.tree[key];\n\n let id: string | undefined;\n let value: OdspSummaryTreeValue | undefined;\n\n // Tracks if an entry is unreferenced. Currently, only tree entries can be marked as unreferenced. If the\n // property is not present, the tree entry is considered referenced. If the property is present and is\n // true (which is the only value it can have), the tree entry is considered unreferenced.\n let unreferenced: true | undefined;\n switch (summaryObject.type) {\n case api.SummaryType.Tree: {\n const result = await this.convertSummaryToSnapshotTree(\n parentHandle,\n summaryObject,\n rootNodeName);\n value = result.snapshotTree;\n unreferenced = markUnreferencedNodes ? summaryObject.unreferenced : undefined;\n blobs += result.blobs;\n break;\n }\n case api.SummaryType.Blob: {\n if (typeof summaryObject.content === \"string\") {\n value = {\n type: \"blob\",\n content: summaryObject.content,\n encoding: \"utf-8\",\n };\n } else {\n value = {\n type: \"blob\",\n content: Uint8ArrayToString(summaryObject.content, \"base64\"),\n encoding: \"base64\",\n };\n }\n blobs++;\n break;\n }\n case api.SummaryType.Handle: {\n if (!parentHandle) {\n throw Error(\"Parent summary does not exist to reference by handle.\");\n }\n let handlePath = summaryObject.handle;\n if (handlePath.length > 0 && !handlePath.startsWith(\"/\")) {\n handlePath = `/${handlePath}`;\n }\n const pathKey = `${rootNodeName}${handlePath}`;\n id = `${parentHandle}/${pathKey}`;\n break;\n }\n case api.SummaryType.Attachment: {\n id = summaryObject.id;\n break;\n }\n default: {\n unreachableCase(summaryObject, `Unknown type: ${(summaryObject as any).type}`);\n }\n }\n\n const baseEntry: IOdspSummaryTreeBaseEntry = {\n path: encodeURIComponent(key),\n type: getGitType(summaryObject),\n };\n\n let entry: OdspSummaryTreeEntry;\n\n if (value) {\n assert(id === undefined, 0x0ad /* \"Snapshot entry has both a tree value and a referenced id!\" */);\n entry = {\n value,\n ...baseEntry,\n unreferenced,\n };\n } else if (id) {\n entry = {\n ...baseEntry,\n id,\n };\n } else {\n throw new Error(`Invalid tree entry for ${summaryObject.type}`);\n }\n\n snapshotTree.entries!.push(entry);\n }\n\n return { snapshotTree, blobs };\n }\n}\n\n/* eslint-enable max-len */\n"]}
|
|
1
|
+
{"version":3,"file":"odspSummaryUploadManager.js","sourceRoot":"","sources":["../src/odspSummaryUploadManager.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;;;;;;;;;;;;;;;;;AAGH,+DAA2F;AAE3F,iEAA2D;AAC3D,0EAA4D;AAE5D,qEAAiH;AAUjH,yEAAsE;AACtE,2CAA0D;AAE1D,4BAA4B;AAE5B;;;GAGG;AACH,MAAa,wBAAwB;IAKjC,YACqB,WAAmB,EACnB,eAAgD,EACjE,MAAwB,EACP,YAA0B,EAC1B,sCAA+C;QAJ/C,gBAAW,GAAX,WAAW,CAAQ;QACnB,oBAAe,GAAf,eAAe,CAAiC;QAEhD,iBAAY,GAAZ,YAAY,CAAc;QAC1B,2CAAsC,GAAtC,sCAAsC,CAAS;QAEhE,IAAI,CAAC,EAAE,GAAG,IAAA,2CAAyB,EAAC,MAAM,CAAC,CAAC;IAChD,CAAC;IAEM,KAAK,CAAC,gBAAgB,CAAC,IAAsB,EAAE,OAAwB;QAC1E,8HAA8H;QAC9H,gIAAgI;QAChI,6GAA6G;QAC7G,IAAI,IAAI,CAAC,yBAAyB,KAAK,SAAS;YAC5C,IAAI,CAAC,yBAAyB,KAAK,OAAO,CAAC,cAAc,EAAE;YAC3D,IAAI,CAAC,EAAE,CAAC,MAAM,CAAC,kBAAkB,CAAC;gBAC9B,SAAS,EAAE,mCAAmC;gBAC9C,0BAA0B,EAAE,OAAO,CAAC,cAAc;gBAClD,yBAAyB,EAAE,IAAI,CAAC,yBAAyB;aAC5D,CAAC,CAAC;SACN;QACD,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,oBAAoB,CAAC,OAAO,CAAC,SAAS,EAAE,OAAO,CAAC,uBAAuB,EAAE,IAAI,CAAC,CAAC;QACzG,MAAM,EAAE,GAAG,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,EAA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9MD,4DA8MC;AAED,2BAA2B","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { ITelemetryLogger } from \"@fluidframework/common-definitions\";\nimport { assert, Uint8ArrayToString, unreachableCase } from \"@fluidframework/common-utils\";\nimport { ISummaryContext } from \"@fluidframework/driver-definitions\";\nimport { getGitType } from \"@fluidframework/protocol-base\";\nimport * as api from \"@fluidframework/protocol-definitions\";\nimport { InstrumentedStorageTokenFetcher } from \"@fluidframework/odsp-driver-definitions\";\nimport { loggerToMonitoringContext, MonitoringContext, PerformanceEvent } from \"@fluidframework/telemetry-utils\";\nimport {\n IOdspSummaryPayload,\n IWriteSummaryResponse,\n IOdspSummaryTree,\n IOdspSummaryTreeBaseEntry,\n OdspSummaryTreeEntry,\n OdspSummaryTreeValue,\n} from \"./contracts\";\nimport { EpochTracker } from \"./epochTracker\";\nimport { getUrlAndHeadersWithAuth } from \"./getUrlAndHeadersWithAuth\";\nimport { getWithRetryForTokenRefresh } from \"./odspUtils\";\n\n/* eslint-disable max-len */\n\n/**\n * This class manages a summary upload. When it receives a call to upload summary, it converts the summary tree into\n * a snapshot tree and then uploads that to the server.\n */\nexport class OdspSummaryUploadManager {\n // Last proposed handle of the uploaded app summary.\n private lastSummaryProposalHandle: string | undefined;\n private readonly mc: MonitoringContext;\n\n constructor(\n private readonly snapshotUrl: string,\n private readonly getStorageToken: InstrumentedStorageTokenFetcher,\n logger: ITelemetryLogger,\n private readonly epochTracker: EpochTracker,\n private readonly forceAccessTokenViaAuthorizationHeader: boolean,\n ) {\n this.mc = loggerToMonitoringContext(logger);\n }\n\n public async writeSummaryTree(tree: api.ISummaryTree, context: ISummaryContext) {\n // If the last proposed handle is not the proposed handle of the acked summary(could happen when the last summary get nacked),\n // then re-initialize the caches with the previous ones else just update the previous caches with the caches from acked summary.\n // Don't bother logging if lastSummaryProposalHandle hasn't been set before; only log on a positive mismatch.\n if (this.lastSummaryProposalHandle !== undefined &&\n this.lastSummaryProposalHandle !== context.proposalHandle) {\n this.mc.logger.sendTelemetryEvent({\n eventName: \"LastSummaryProposedHandleMismatch\",\n ackedSummaryProposedHandle: context.proposalHandle,\n lastSummaryProposalHandle: this.lastSummaryProposalHandle,\n });\n }\n const result = await this.writeSummaryTreeCore(context.ackHandle, context.referenceSequenceNumber, tree);\n const id = result ? result.id : undefined;\n if (!result || !id) {\n throw new Error(`Failed to write summary tree`);\n }\n this.lastSummaryProposalHandle = id;\n return id;\n }\n\n private async writeSummaryTreeCore(\n parentHandle: string | undefined,\n referenceSequenceNumber: number,\n tree: api.ISummaryTree,\n ): Promise<IWriteSummaryResponse> {\n const containsProtocolTree = Object.keys(tree.tree).includes(\".protocol\");\n const { snapshotTree, blobs } = await this.convertSummaryToSnapshotTree(\n parentHandle,\n tree,\n \".app\",\n );\n const snapshot: IOdspSummaryPayload = {\n entries: snapshotTree.entries!,\n message: \"app\",\n sequenceNumber: referenceSequenceNumber,\n // no ack handle implies this is initial summary after empty file creation.\n // send container payload so server will use it without a summary op\n type: containsProtocolTree || parentHandle === undefined ? \"container\" : \"channel\",\n };\n\n return getWithRetryForTokenRefresh(async (options) => {\n const storageToken = await this.getStorageToken(options, \"WriteSummaryTree\");\n\n const { url, headers } = getUrlAndHeadersWithAuth(\n `${this.snapshotUrl}/snapshot`,\n storageToken,\n this.forceAccessTokenViaAuthorizationHeader,\n );\n headers[\"Content-Type\"] = \"application/json\";\n if (parentHandle) {\n headers[\"If-Match\"] = `fluid:containerid=${parentHandle}`;\n }\n\n const postBody = JSON.stringify(snapshot);\n\n return PerformanceEvent.timedExecAsync(this.mc.logger,\n {\n eventName: \"uploadSummary\",\n attempt: options.refresh ? 2 : 1,\n hasClaims: !!options.claims,\n hasTenantId: !!options.tenantId,\n headers: Object.keys(headers).length !== 0 ? true : undefined,\n blobs,\n size: postBody.length,\n referenceSequenceNumber,\n type: snapshot.type,\n },\n async () => {\n const response = await this.epochTracker.fetchAndParseAsJSON<IWriteSummaryResponse>(\n url,\n {\n body: postBody,\n headers,\n method: \"POST\",\n },\n \"uploadSummary\");\n return response.content;\n });\n });\n }\n\n /**\n * Following are the goals of this function.\n * a.) Converts the summary tree to a snapshot/odsp tree to be uploaded. Always upload full snapshot tree.\n * @param parentHandle - Handle of the last uploaded summary or detach new summary.\n * @param tree - Summary Tree which will be converted to snapshot tree to be uploaded.\n * @param rootNodeName - Root node name of the summary tree.\n * @param path - Current path of node which is getting evaluated.\n * @param markUnreferencedNodes - True if we should mark unreferenced nodes.\n */\n private async convertSummaryToSnapshotTree(\n parentHandle: string | undefined,\n tree: api.ISummaryTree,\n rootNodeName: string,\n markUnreferencedNodes: boolean = this.mc.config.getBoolean(\"Fluid.Driver.Odsp.MarkUnreferencedNodes\") ?? true,\n ) {\n const snapshotTree: IOdspSummaryTree = {\n type: \"tree\",\n entries: [] as OdspSummaryTreeEntry[],\n };\n\n let blobs = 0;\n const keys = Object.keys(tree.tree);\n for (const key of keys) {\n const summaryObject = tree.tree[key];\n\n let id: string | undefined;\n let value: OdspSummaryTreeValue | undefined;\n\n // Tracks if an entry is unreferenced. Currently, only tree entries can be marked as unreferenced. If the\n // property is not present, the tree entry is considered referenced. If the property is present and is\n // true (which is the only value it can have), the tree entry is considered unreferenced.\n let unreferenced: true | undefined;\n switch (summaryObject.type) {\n case api.SummaryType.Tree: {\n const result = await this.convertSummaryToSnapshotTree(\n parentHandle,\n summaryObject,\n rootNodeName);\n value = result.snapshotTree;\n unreferenced = markUnreferencedNodes ? summaryObject.unreferenced : undefined;\n blobs += result.blobs;\n break;\n }\n case api.SummaryType.Blob: {\n if (typeof summaryObject.content === \"string\") {\n value = {\n type: \"blob\",\n content: summaryObject.content,\n encoding: \"utf-8\",\n };\n } else {\n value = {\n type: \"blob\",\n content: Uint8ArrayToString(summaryObject.content, \"base64\"),\n encoding: \"base64\",\n };\n }\n blobs++;\n break;\n }\n case api.SummaryType.Handle: {\n if (!parentHandle) {\n throw Error(\"Parent summary does not exist to reference by handle.\");\n }\n let handlePath = summaryObject.handle;\n if (handlePath.length > 0 && !handlePath.startsWith(\"/\")) {\n handlePath = `/${handlePath}`;\n }\n const pathKey = `${rootNodeName}${handlePath}`;\n id = `${parentHandle}/${pathKey}`;\n break;\n }\n case api.SummaryType.Attachment: {\n id = summaryObject.id;\n break;\n }\n default: {\n unreachableCase(summaryObject, `Unknown type: ${(summaryObject as any).type}`);\n }\n }\n\n const baseEntry: IOdspSummaryTreeBaseEntry = {\n path: encodeURIComponent(key),\n type: getGitType(summaryObject),\n };\n\n let entry: OdspSummaryTreeEntry;\n\n if (value) {\n assert(id === undefined, 0x0ad /* \"Snapshot entry has both a tree value and a referenced id!\" */);\n entry = {\n value,\n ...baseEntry,\n unreferenced,\n };\n } else if (id) {\n entry = {\n ...baseEntry,\n id,\n };\n } else {\n throw new Error(`Invalid tree entry for ${summaryObject.type}`);\n }\n\n snapshotTree.entries!.push(entry);\n }\n\n return { snapshotTree, blobs };\n }\n}\n\n/* eslint-enable max-len */\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 = "0.59.
|
|
8
|
+
export declare const pkgVersion = "0.59.4003";
|
|
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 = "0.59.
|
|
11
|
+
exports.pkgVersion = "0.59.4003";
|
|
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,WAAW,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 = \"0.59.
|
|
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,WAAW,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 = \"0.59.4003\";\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"odspSummaryUploadManager.d.ts","sourceRoot":"","sources":["../src/odspSummaryUploadManager.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AAEtE,OAAO,EAAE,eAAe,EAAE,MAAM,oCAAoC,CAAC;AAErE,OAAO,KAAK,GAAG,MAAM,sCAAsC,CAAC;AAC5D,OAAO,EAAE,+BAA+B,EAAE,MAAM,yCAAyC,CAAC;AAU1F,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAM9C;;;GAGG;AACH,qBAAa,wBAAwB;IAM7B,OAAO,CAAC,QAAQ,CAAC,WAAW;IAC5B,OAAO,CAAC,QAAQ,CAAC,eAAe;IAEhC,OAAO,CAAC,QA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;;;;;OAQG;YACW,4BAA4B;CAoG7C"}
|
|
@@ -42,9 +42,7 @@ export class OdspSummaryUploadManager {
|
|
|
42
42
|
return id;
|
|
43
43
|
}
|
|
44
44
|
async writeSummaryTreeCore(parentHandle, referenceSequenceNumber, tree) {
|
|
45
|
-
const
|
|
46
|
-
const containsProtocolTree = enableContainerTypeSummaryUpload &&
|
|
47
|
-
Object.keys(tree.tree).includes(".protocol");
|
|
45
|
+
const containsProtocolTree = Object.keys(tree.tree).includes(".protocol");
|
|
48
46
|
const { snapshotTree, blobs } = await this.convertSummaryToSnapshotTree(parentHandle, tree, ".app");
|
|
49
47
|
const snapshot = {
|
|
50
48
|
entries: snapshotTree.entries,
|
|
@@ -72,7 +70,6 @@ export class OdspSummaryUploadManager {
|
|
|
72
70
|
size: postBody.length,
|
|
73
71
|
referenceSequenceNumber,
|
|
74
72
|
type: snapshot.type,
|
|
75
|
-
enableContainerTypeSummaryUpload,
|
|
76
73
|
}, async () => {
|
|
77
74
|
const response = await this.epochTracker.fetchAndParseAsJSON(url, {
|
|
78
75
|
body: postBody,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"odspSummaryUploadManager.js","sourceRoot":"","sources":["../src/odspSummaryUploadManager.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,MAAM,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAE3F,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAC3D,OAAO,KAAK,GAAG,MAAM,sCAAsC,CAAC;AAE5D,OAAO,EAAE,yBAAyB,EAAqB,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AAUjH,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AACtE,OAAO,EAAE,2BAA2B,EAAE,MAAM,aAAa,CAAC;AAE1D,4BAA4B;AAE5B;;;GAGG;AACH,MAAM,OAAO,wBAAwB;IAKjC,YACqB,WAAmB,EACnB,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AE,CAAC;oBAC/C,EAAE,GAAG,GAAG,YAAY,IAAI,OAAO,EAAE,CAAC;oBAClC,MAAM;iBACT;gBACD,KAAK,GAAG,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;oBAC7B,EAAE,GAAG,aAAa,CAAC,EAAE,CAAC;oBACtB,MAAM;iBACT;gBACD,OAAO,CAAC,CAAC;oBACL,eAAe,CAAC,aAAa,EAAE,iBAAkB,aAAqB,CAAC,IAAI,EAAE,CAAC,CAAC;iBAClF;aACJ;YAED,MAAM,SAAS,GAA8B;gBACzC,IAAI,EAAE,kBAAkB,CAAC,GAAG,CAAC;gBAC7B,IAAI,EAAE,UAAU,CAAC,aAAa,CAAC;aAClC,CAAC;YAEF,IAAI,KAA2B,CAAC;YAEhC,IAAI,KAAK,EAAE;gBACP,MAAM,CAAC,EAAE,KAAK,SAAS,EAAE,KAAK,CAAC,iEAAiE,CAAC,CAAC;gBAClG,KAAK,iCACD,KAAK,IACF,SAAS,KACZ,YAAY,GACf,CAAC;aACL;iBAAM,IAAI,EAAE,EAAE;gBACX,KAAK,mCACE,SAAS,KACZ,EAAE,GACL,CAAC;aACL;iBAAM;gBACH,MAAM,IAAI,KAAK,CAAC,0BAA0B,aAAa,CAAC,IAAI,EAAE,CAAC,CAAC;aACnE;YAED,YAAY,CAAC,OAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;SACrC;QAED,OAAO,EAAE,YAAY,EAAE,KAAK,EAAE,CAAC;IACnC,CAAC;CACJ;AAED,2BAA2B","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { ITelemetryLogger } from \"@fluidframework/common-definitions\";\nimport { assert, Uint8ArrayToString, unreachableCase } from \"@fluidframework/common-utils\";\nimport { ISummaryContext } from \"@fluidframework/driver-definitions\";\nimport { getGitType } from \"@fluidframework/protocol-base\";\nimport * as api from \"@fluidframework/protocol-definitions\";\nimport { InstrumentedStorageTokenFetcher } from \"@fluidframework/odsp-driver-definitions\";\nimport { loggerToMonitoringContext, MonitoringContext, PerformanceEvent } from \"@fluidframework/telemetry-utils\";\nimport {\n IOdspSummaryPayload,\n IWriteSummaryResponse,\n IOdspSummaryTree,\n IOdspSummaryTreeBaseEntry,\n OdspSummaryTreeEntry,\n OdspSummaryTreeValue,\n} from \"./contracts\";\nimport { EpochTracker } from \"./epochTracker\";\nimport { getUrlAndHeadersWithAuth } from \"./getUrlAndHeadersWithAuth\";\nimport { getWithRetryForTokenRefresh } from \"./odspUtils\";\n\n/* eslint-disable max-len */\n\n/**\n * This class manages a summary upload. When it receives a call to upload summary, it converts the summary tree into\n * a snapshot tree and then uploads that to the server.\n */\nexport class OdspSummaryUploadManager {\n // Last proposed handle of the uploaded app summary.\n private lastSummaryProposalHandle: string | undefined;\n private readonly mc: MonitoringContext;\n\n constructor(\n private readonly snapshotUrl: string,\n private readonly getStorageToken: InstrumentedStorageTokenFetcher,\n logger: ITelemetryLogger,\n private readonly epochTracker: EpochTracker,\n private readonly forceAccessTokenViaAuthorizationHeader: boolean,\n ) {\n this.mc = loggerToMonitoringContext(logger);\n }\n\n public async writeSummaryTree(tree: api.ISummaryTree, context: ISummaryContext) {\n // If the last proposed handle is not the proposed handle of the acked summary(could happen when the last summary get nacked),\n // then re-initialize the caches with the previous ones else just update the previous caches with the caches from acked summary.\n // Don't bother logging if lastSummaryProposalHandle hasn't been set before; only log on a positive mismatch.\n if (this.lastSummaryProposalHandle !== undefined &&\n this.lastSummaryProposalHandle !== context.proposalHandle) {\n this.mc.logger.sendTelemetryEvent({\n eventName: \"LastSummaryProposedHandleMismatch\",\n ackedSummaryProposedHandle: context.proposalHandle,\n lastSummaryProposalHandle: this.lastSummaryProposalHandle,\n });\n }\n const result = await this.writeSummaryTreeCore(context.ackHandle, context.referenceSequenceNumber, tree);\n const id = result ? result.id : undefined;\n if (!result || !id) {\n throw new Error(`Failed to write summary tree`);\n }\n this.lastSummaryProposalHandle = id;\n return id;\n }\n\n private async writeSummaryTreeCore(\n parentHandle: string | undefined,\n referenceSequenceNumber: number,\n tree: api.ISummaryTree,\n ): Promise<IWriteSummaryResponse> {\n const enableContainerTypeSummaryUpload = this.mc.config.getBoolean(\"Fluid.Driver.Odsp.EnableContainerTypeSummaryUpload\");\n const containsProtocolTree = enableContainerTypeSummaryUpload &&\n Object.keys(tree.tree).includes(\".protocol\");\n const { snapshotTree, blobs } = await this.convertSummaryToSnapshotTree(\n parentHandle,\n tree,\n \".app\",\n );\n const snapshot: IOdspSummaryPayload = {\n entries: snapshotTree.entries!,\n message: \"app\",\n sequenceNumber: referenceSequenceNumber,\n // no ack handle implies this is initial summary after empty file creation.\n // send container payload so server will use it without a summary op\n type: containsProtocolTree || parentHandle === undefined ? \"container\" : \"channel\",\n };\n\n return getWithRetryForTokenRefresh(async (options) => {\n const storageToken = await this.getStorageToken(options, \"WriteSummaryTree\");\n\n const { url, headers } = getUrlAndHeadersWithAuth(\n `${this.snapshotUrl}/snapshot`,\n storageToken,\n this.forceAccessTokenViaAuthorizationHeader,\n );\n headers[\"Content-Type\"] = \"application/json\";\n if (parentHandle) {\n headers[\"If-Match\"] = `fluid:containerid=${parentHandle}`;\n }\n\n const postBody = JSON.stringify(snapshot);\n\n return PerformanceEvent.timedExecAsync(this.mc.logger,\n {\n eventName: \"uploadSummary\",\n attempt: options.refresh ? 2 : 1,\n hasClaims: !!options.claims,\n hasTenantId: !!options.tenantId,\n headers: Object.keys(headers).length !== 0 ? true : undefined,\n blobs,\n size: postBody.length,\n referenceSequenceNumber,\n type: snapshot.type,\n enableContainerTypeSummaryUpload,\n },\n async () => {\n const response = await this.epochTracker.fetchAndParseAsJSON<IWriteSummaryResponse>(\n url,\n {\n body: postBody,\n headers,\n method: \"POST\",\n },\n \"uploadSummary\");\n return response.content;\n });\n });\n }\n\n /**\n * Following are the goals of this function.\n * a.) Converts the summary tree to a snapshot/odsp tree to be uploaded. Always upload full snapshot tree.\n * @param parentHandle - Handle of the last uploaded summary or detach new summary.\n * @param tree - Summary Tree which will be converted to snapshot tree to be uploaded.\n * @param rootNodeName - Root node name of the summary tree.\n * @param path - Current path of node which is getting evaluated.\n * @param markUnreferencedNodes - True if we should mark unreferenced nodes.\n */\n private async convertSummaryToSnapshotTree(\n parentHandle: string | undefined,\n tree: api.ISummaryTree,\n rootNodeName: string,\n markUnreferencedNodes: boolean = this.mc.config.getBoolean(\"Fluid.Driver.Odsp.MarkUnreferencedNodes\") ?? true,\n ) {\n const snapshotTree: IOdspSummaryTree = {\n type: \"tree\",\n entries: [] as OdspSummaryTreeEntry[],\n };\n\n let blobs = 0;\n const keys = Object.keys(tree.tree);\n for (const key of keys) {\n const summaryObject = tree.tree[key];\n\n let id: string | undefined;\n let value: OdspSummaryTreeValue | undefined;\n\n // Tracks if an entry is unreferenced. Currently, only tree entries can be marked as unreferenced. If the\n // property is not present, the tree entry is considered referenced. If the property is present and is\n // true (which is the only value it can have), the tree entry is considered unreferenced.\n let unreferenced: true | undefined;\n switch (summaryObject.type) {\n case api.SummaryType.Tree: {\n const result = await this.convertSummaryToSnapshotTree(\n parentHandle,\n summaryObject,\n rootNodeName);\n value = result.snapshotTree;\n unreferenced = markUnreferencedNodes ? summaryObject.unreferenced : undefined;\n blobs += result.blobs;\n break;\n }\n case api.SummaryType.Blob: {\n if (typeof summaryObject.content === \"string\") {\n value = {\n type: \"blob\",\n content: summaryObject.content,\n encoding: \"utf-8\",\n };\n } else {\n value = {\n type: \"blob\",\n content: Uint8ArrayToString(summaryObject.content, \"base64\"),\n encoding: \"base64\",\n };\n }\n blobs++;\n break;\n }\n case api.SummaryType.Handle: {\n if (!parentHandle) {\n throw Error(\"Parent summary does not exist to reference by handle.\");\n }\n let handlePath = summaryObject.handle;\n if (handlePath.length > 0 && !handlePath.startsWith(\"/\")) {\n handlePath = `/${handlePath}`;\n }\n const pathKey = `${rootNodeName}${handlePath}`;\n id = `${parentHandle}/${pathKey}`;\n break;\n }\n case api.SummaryType.Attachment: {\n id = summaryObject.id;\n break;\n }\n default: {\n unreachableCase(summaryObject, `Unknown type: ${(summaryObject as any).type}`);\n }\n }\n\n const baseEntry: IOdspSummaryTreeBaseEntry = {\n path: encodeURIComponent(key),\n type: getGitType(summaryObject),\n };\n\n let entry: OdspSummaryTreeEntry;\n\n if (value) {\n assert(id === undefined, 0x0ad /* \"Snapshot entry has both a tree value and a referenced id!\" */);\n entry = {\n value,\n ...baseEntry,\n unreferenced,\n };\n } else if (id) {\n entry = {\n ...baseEntry,\n id,\n };\n } else {\n throw new Error(`Invalid tree entry for ${summaryObject.type}`);\n }\n\n snapshotTree.entries!.push(entry);\n }\n\n return { snapshotTree, blobs };\n }\n}\n\n/* eslint-enable max-len */\n"]}
|
|
1
|
+
{"version":3,"file":"odspSummaryUploadManager.js","sourceRoot":"","sources":["../src/odspSummaryUploadManager.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,MAAM,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAE3F,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAC3D,OAAO,KAAK,GAAG,MAAM,sCAAsC,CAAC;AAE5D,OAAO,EAAE,yBAAyB,EAAqB,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AAUjH,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AACtE,OAAO,EAAE,2BAA2B,EAAE,MAAM,aAAa,CAAC;AAE1D,4BAA4B;AAE5B;;;GAGG;AACH,MAAM,OAAO,wBAAwB;IAKjC,YACqB,WAAmB,EACnB,eAAgD,EACjE,MAAwB,EACP,YAA0B,EAC1B,sCAA+C;QAJ/C,gBAAW,GAAX,WAAW,CAAQ;QACnB,oBAAe,GAAf,eAAe,CAAiC;QAEhD,iBAAY,GAAZ,YAAY,CAAc;QAC1B,2CAAsC,GAAtC,sCAAsC,CAAS;QAEhE,IAAI,CAAC,EAAE,GAAG,yBAAyB,CAAC,MAAM,CAAC,CAAC;IACh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G,CAAC;gBAC7B,IAAI,EAAE,UAAU,CAAC,aAAa,CAAC;aAClC,CAAC;YAEF,IAAI,KAA2B,CAAC;YAEhC,IAAI,KAAK,EAAE;gBACP,MAAM,CAAC,EAAE,KAAK,SAAS,EAAE,KAAK,CAAC,iEAAiE,CAAC,CAAC;gBAClG,KAAK,iCACD,KAAK,IACF,SAAS,KACZ,YAAY,GACf,CAAC;aACL;iBAAM,IAAI,EAAE,EAAE;gBACX,KAAK,mCACE,SAAS,KACZ,EAAE,GACL,CAAC;aACL;iBAAM;gBACH,MAAM,IAAI,KAAK,CAAC,0BAA0B,aAAa,CAAC,IAAI,EAAE,CAAC,CAAC;aACnE;YAED,YAAY,CAAC,OAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;SACrC;QAED,OAAO,EAAE,YAAY,EAAE,KAAK,EAAE,CAAC;IACnC,CAAC;CACJ;AAED,2BAA2B","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { ITelemetryLogger } from \"@fluidframework/common-definitions\";\nimport { assert, Uint8ArrayToString, unreachableCase } from \"@fluidframework/common-utils\";\nimport { ISummaryContext } from \"@fluidframework/driver-definitions\";\nimport { getGitType } from \"@fluidframework/protocol-base\";\nimport * as api from \"@fluidframework/protocol-definitions\";\nimport { InstrumentedStorageTokenFetcher } from \"@fluidframework/odsp-driver-definitions\";\nimport { loggerToMonitoringContext, MonitoringContext, PerformanceEvent } from \"@fluidframework/telemetry-utils\";\nimport {\n IOdspSummaryPayload,\n IWriteSummaryResponse,\n IOdspSummaryTree,\n IOdspSummaryTreeBaseEntry,\n OdspSummaryTreeEntry,\n OdspSummaryTreeValue,\n} from \"./contracts\";\nimport { EpochTracker } from \"./epochTracker\";\nimport { getUrlAndHeadersWithAuth } from \"./getUrlAndHeadersWithAuth\";\nimport { getWithRetryForTokenRefresh } from \"./odspUtils\";\n\n/* eslint-disable max-len */\n\n/**\n * This class manages a summary upload. When it receives a call to upload summary, it converts the summary tree into\n * a snapshot tree and then uploads that to the server.\n */\nexport class OdspSummaryUploadManager {\n // Last proposed handle of the uploaded app summary.\n private lastSummaryProposalHandle: string | undefined;\n private readonly mc: MonitoringContext;\n\n constructor(\n private readonly snapshotUrl: string,\n private readonly getStorageToken: InstrumentedStorageTokenFetcher,\n logger: ITelemetryLogger,\n private readonly epochTracker: EpochTracker,\n private readonly forceAccessTokenViaAuthorizationHeader: boolean,\n ) {\n this.mc = loggerToMonitoringContext(logger);\n }\n\n public async writeSummaryTree(tree: api.ISummaryTree, context: ISummaryContext) {\n // If the last proposed handle is not the proposed handle of the acked summary(could happen when the last summary get nacked),\n // then re-initialize the caches with the previous ones else just update the previous caches with the caches from acked summary.\n // Don't bother logging if lastSummaryProposalHandle hasn't been set before; only log on a positive mismatch.\n if (this.lastSummaryProposalHandle !== undefined &&\n this.lastSummaryProposalHandle !== context.proposalHandle) {\n this.mc.logger.sendTelemetryEvent({\n eventName: \"LastSummaryProposedHandleMismatch\",\n ackedSummaryProposedHandle: context.proposalHandle,\n lastSummaryProposalHandle: this.lastSummaryProposalHandle,\n });\n }\n const result = await this.writeSummaryTreeCore(context.ackHandle, context.referenceSequenceNumber, tree);\n const id = result ? result.id : undefined;\n if (!result || !id) {\n throw new Error(`Failed to write summary tree`);\n }\n this.lastSummaryProposalHandle = id;\n return id;\n }\n\n private async writeSummaryTreeCore(\n parentHandle: string | undefined,\n referenceSequenceNumber: number,\n tree: api.ISummaryTree,\n ): Promise<IWriteSummaryResponse> {\n const containsProtocolTree = Object.keys(tree.tree).includes(\".protocol\");\n const { snapshotTree, blobs } = await this.convertSummaryToSnapshotTree(\n parentHandle,\n tree,\n \".app\",\n );\n const snapshot: IOdspSummaryPayload = {\n entries: snapshotTree.entries!,\n message: \"app\",\n sequenceNumber: referenceSequenceNumber,\n // no ack handle implies this is initial summary after empty file creation.\n // send container payload so server will use it without a summary op\n type: containsProtocolTree || parentHandle === undefined ? \"container\" : \"channel\",\n };\n\n return getWithRetryForTokenRefresh(async (options) => {\n const storageToken = await this.getStorageToken(options, \"WriteSummaryTree\");\n\n const { url, headers } = getUrlAndHeadersWithAuth(\n `${this.snapshotUrl}/snapshot`,\n storageToken,\n this.forceAccessTokenViaAuthorizationHeader,\n );\n headers[\"Content-Type\"] = \"application/json\";\n if (parentHandle) {\n headers[\"If-Match\"] = `fluid:containerid=${parentHandle}`;\n }\n\n const postBody = JSON.stringify(snapshot);\n\n return PerformanceEvent.timedExecAsync(this.mc.logger,\n {\n eventName: \"uploadSummary\",\n attempt: options.refresh ? 2 : 1,\n hasClaims: !!options.claims,\n hasTenantId: !!options.tenantId,\n headers: Object.keys(headers).length !== 0 ? true : undefined,\n blobs,\n size: postBody.length,\n referenceSequenceNumber,\n type: snapshot.type,\n },\n async () => {\n const response = await this.epochTracker.fetchAndParseAsJSON<IWriteSummaryResponse>(\n url,\n {\n body: postBody,\n headers,\n method: \"POST\",\n },\n \"uploadSummary\");\n return response.content;\n });\n });\n }\n\n /**\n * Following are the goals of this function.\n * a.) Converts the summary tree to a snapshot/odsp tree to be uploaded. Always upload full snapshot tree.\n * @param parentHandle - Handle of the last uploaded summary or detach new summary.\n * @param tree - Summary Tree which will be converted to snapshot tree to be uploaded.\n * @param rootNodeName - Root node name of the summary tree.\n * @param path - Current path of node which is getting evaluated.\n * @param markUnreferencedNodes - True if we should mark unreferenced nodes.\n */\n private async convertSummaryToSnapshotTree(\n parentHandle: string | undefined,\n tree: api.ISummaryTree,\n rootNodeName: string,\n markUnreferencedNodes: boolean = this.mc.config.getBoolean(\"Fluid.Driver.Odsp.MarkUnreferencedNodes\") ?? true,\n ) {\n const snapshotTree: IOdspSummaryTree = {\n type: \"tree\",\n entries: [] as OdspSummaryTreeEntry[],\n };\n\n let blobs = 0;\n const keys = Object.keys(tree.tree);\n for (const key of keys) {\n const summaryObject = tree.tree[key];\n\n let id: string | undefined;\n let value: OdspSummaryTreeValue | undefined;\n\n // Tracks if an entry is unreferenced. Currently, only tree entries can be marked as unreferenced. If the\n // property is not present, the tree entry is considered referenced. If the property is present and is\n // true (which is the only value it can have), the tree entry is considered unreferenced.\n let unreferenced: true | undefined;\n switch (summaryObject.type) {\n case api.SummaryType.Tree: {\n const result = await this.convertSummaryToSnapshotTree(\n parentHandle,\n summaryObject,\n rootNodeName);\n value = result.snapshotTree;\n unreferenced = markUnreferencedNodes ? summaryObject.unreferenced : undefined;\n blobs += result.blobs;\n break;\n }\n case api.SummaryType.Blob: {\n if (typeof summaryObject.content === \"string\") {\n value = {\n type: \"blob\",\n content: summaryObject.content,\n encoding: \"utf-8\",\n };\n } else {\n value = {\n type: \"blob\",\n content: Uint8ArrayToString(summaryObject.content, \"base64\"),\n encoding: \"base64\",\n };\n }\n blobs++;\n break;\n }\n case api.SummaryType.Handle: {\n if (!parentHandle) {\n throw Error(\"Parent summary does not exist to reference by handle.\");\n }\n let handlePath = summaryObject.handle;\n if (handlePath.length > 0 && !handlePath.startsWith(\"/\")) {\n handlePath = `/${handlePath}`;\n }\n const pathKey = `${rootNodeName}${handlePath}`;\n id = `${parentHandle}/${pathKey}`;\n break;\n }\n case api.SummaryType.Attachment: {\n id = summaryObject.id;\n break;\n }\n default: {\n unreachableCase(summaryObject, `Unknown type: ${(summaryObject as any).type}`);\n }\n }\n\n const baseEntry: IOdspSummaryTreeBaseEntry = {\n path: encodeURIComponent(key),\n type: getGitType(summaryObject),\n };\n\n let entry: OdspSummaryTreeEntry;\n\n if (value) {\n assert(id === undefined, 0x0ad /* \"Snapshot entry has both a tree value and a referenced id!\" */);\n entry = {\n value,\n ...baseEntry,\n unreferenced,\n };\n } else if (id) {\n entry = {\n ...baseEntry,\n id,\n };\n } else {\n throw new Error(`Invalid tree entry for ${summaryObject.type}`);\n }\n\n snapshotTree.entries!.push(entry);\n }\n\n return { snapshotTree, blobs };\n }\n}\n\n/* eslint-enable max-len */\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 = "0.59.
|
|
8
|
+
export declare const pkgVersion = "0.59.4003";
|
|
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,WAAW,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 = \"0.59.
|
|
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,WAAW,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 = \"0.59.4003\";\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluidframework/odsp-driver",
|
|
3
|
-
"version": "0.59.
|
|
3
|
+
"version": "0.59.4003",
|
|
4
4
|
"description": "Socket storage implementation for SPO and ODC",
|
|
5
5
|
"homepage": "https://fluidframework.com",
|
|
6
6
|
"repository": {
|
|
@@ -63,15 +63,15 @@
|
|
|
63
63
|
"@fluidframework/common-definitions": "^0.20.1",
|
|
64
64
|
"@fluidframework/common-utils": "^0.32.1",
|
|
65
65
|
"@fluidframework/core-interfaces": "^0.43.1000",
|
|
66
|
-
"@fluidframework/driver-base": "^0.59.
|
|
66
|
+
"@fluidframework/driver-base": "^0.59.4003",
|
|
67
67
|
"@fluidframework/driver-definitions": "^0.46.2000",
|
|
68
|
-
"@fluidframework/driver-utils": "^0.59.
|
|
68
|
+
"@fluidframework/driver-utils": "^0.59.4003",
|
|
69
69
|
"@fluidframework/gitresources": "^0.1036.4000",
|
|
70
|
-
"@fluidframework/odsp-doclib-utils": "^0.59.
|
|
71
|
-
"@fluidframework/odsp-driver-definitions": "^0.59.
|
|
70
|
+
"@fluidframework/odsp-doclib-utils": "^0.59.4003",
|
|
71
|
+
"@fluidframework/odsp-driver-definitions": "^0.59.4003",
|
|
72
72
|
"@fluidframework/protocol-base": "^0.1036.4000",
|
|
73
73
|
"@fluidframework/protocol-definitions": "^0.1028.2000",
|
|
74
|
-
"@fluidframework/telemetry-utils": "^0.59.
|
|
74
|
+
"@fluidframework/telemetry-utils": "^0.59.4003",
|
|
75
75
|
"abort-controller": "^3.0.0",
|
|
76
76
|
"node-fetch": "^2.6.1",
|
|
77
77
|
"socket.io-client": "^4.4.1",
|
|
@@ -81,8 +81,8 @@
|
|
|
81
81
|
"@fluidframework/build-common": "^0.23.0",
|
|
82
82
|
"@fluidframework/build-tools": "^0.2.70857",
|
|
83
83
|
"@fluidframework/eslint-config-fluid": "^0.28.2000",
|
|
84
|
-
"@fluidframework/mocha-test-setup": "^0.59.
|
|
85
|
-
"@fluidframework/odsp-driver-previous": "npm:@fluidframework/odsp-driver@0.59.
|
|
84
|
+
"@fluidframework/mocha-test-setup": "^0.59.4003",
|
|
85
|
+
"@fluidframework/odsp-driver-previous": "npm:@fluidframework/odsp-driver@0.59.4002",
|
|
86
86
|
"@microsoft/api-extractor": "^7.22.2",
|
|
87
87
|
"@rushstack/eslint-config": "^2.5.1",
|
|
88
88
|
"@types/mocha": "^9.1.1",
|
|
@@ -113,7 +113,7 @@
|
|
|
113
113
|
"typescript-formatter": "7.1.0"
|
|
114
114
|
},
|
|
115
115
|
"typeValidation": {
|
|
116
|
-
"version": "0.59.
|
|
116
|
+
"version": "0.59.4003",
|
|
117
117
|
"broken": {}
|
|
118
118
|
}
|
|
119
119
|
}
|
|
@@ -69,9 +69,7 @@ export class OdspSummaryUploadManager {
|
|
|
69
69
|
referenceSequenceNumber: number,
|
|
70
70
|
tree: api.ISummaryTree,
|
|
71
71
|
): Promise<IWriteSummaryResponse> {
|
|
72
|
-
const
|
|
73
|
-
const containsProtocolTree = enableContainerTypeSummaryUpload &&
|
|
74
|
-
Object.keys(tree.tree).includes(".protocol");
|
|
72
|
+
const containsProtocolTree = Object.keys(tree.tree).includes(".protocol");
|
|
75
73
|
const { snapshotTree, blobs } = await this.convertSummaryToSnapshotTree(
|
|
76
74
|
parentHandle,
|
|
77
75
|
tree,
|
|
@@ -112,7 +110,6 @@ export class OdspSummaryUploadManager {
|
|
|
112
110
|
size: postBody.length,
|
|
113
111
|
referenceSequenceNumber,
|
|
114
112
|
type: snapshot.type,
|
|
115
|
-
enableContainerTypeSummaryUpload,
|
|
116
113
|
},
|
|
117
114
|
async () => {
|
|
118
115
|
const response = await this.epochTracker.fetchAndParseAsJSON<IWriteSummaryResponse>(
|
package/src/packageVersion.ts
CHANGED