@fluidframework/odsp-driver 2.41.0 → 2.42.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluidframework/odsp-driver",
3
- "version": "2.41.0",
3
+ "version": "2.42.0",
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.41.0",
73
- "@fluidframework/core-interfaces": "~2.41.0",
74
- "@fluidframework/core-utils": "~2.41.0",
75
- "@fluidframework/driver-base": "~2.41.0",
76
- "@fluidframework/driver-definitions": "~2.41.0",
77
- "@fluidframework/driver-utils": "~2.41.0",
78
- "@fluidframework/odsp-doclib-utils": "~2.41.0",
79
- "@fluidframework/odsp-driver-definitions": "~2.41.0",
80
- "@fluidframework/telemetry-utils": "~2.41.0",
72
+ "@fluid-internal/client-utils": "~2.42.0",
73
+ "@fluidframework/core-interfaces": "~2.42.0",
74
+ "@fluidframework/core-utils": "~2.42.0",
75
+ "@fluidframework/driver-base": "~2.42.0",
76
+ "@fluidframework/driver-definitions": "~2.42.0",
77
+ "@fluidframework/driver-utils": "~2.42.0",
78
+ "@fluidframework/odsp-doclib-utils": "~2.42.0",
79
+ "@fluidframework/odsp-driver-definitions": "~2.42.0",
80
+ "@fluidframework/telemetry-utils": "~2.42.0",
81
81
  "socket.io-client": "~4.7.5",
82
82
  "uuid": "^9.0.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.41.0",
87
+ "@fluid-internal/mocha-test-setup": "~2.42.0",
88
88
  "@fluid-tools/build-cli": "^0.55.0",
89
89
  "@fluidframework/build-common": "^2.0.3",
90
90
  "@fluidframework/build-tools": "^0.55.0",
91
91
  "@fluidframework/eslint-config-fluid": "^5.7.4",
92
- "@fluidframework/odsp-driver-previous": "npm:@fluidframework/odsp-driver@2.40.0",
92
+ "@fluidframework/odsp-driver-previous": "npm:@fluidframework/odsp-driver@2.41.0",
93
93
  "@microsoft/api-extractor": "7.52.8",
94
94
  "@types/mocha": "^10.0.10",
95
95
  "@types/node": "^18.19.0",
@@ -212,7 +212,7 @@ export async function createNewEmptyFluidFile(
212
212
  const encodedFilename = encodeURIComponent(`${newFileInfo.filename}.tmp`);
213
213
  const initialUrl = `${getApiRoot(new URL(newFileInfo.siteUrl))}/drives/${
214
214
  newFileInfo.driveId
215
- }/items/root:/${filePath}/${encodedFilename}:/content?@name.conflictBehavior=rename&select=id,name,parentReference`;
215
+ }/items/root:${filePath}/${encodedFilename}:/content?@name.conflictBehavior=rename&select=id,name,parentReference`;
216
216
 
217
217
  return getWithRetryForTokenRefresh(async (options) => {
218
218
  const url = initialUrl;
@@ -27,7 +27,6 @@ import {
27
27
  ITelemetryLoggerExt,
28
28
  PerformanceEvent,
29
29
  isFluidError,
30
- loggerToMonitoringContext,
31
30
  wrapError,
32
31
  } from "@fluidframework/telemetry-utils/internal";
33
32
  import { v4 as uuid } from "uuid";
@@ -215,7 +214,7 @@ async function redeemSharingLink(
215
214
  {
216
215
  eventName: "RedeemShareLink",
217
216
  },
218
- async () => {
217
+ async (event) => {
219
218
  assert(
220
219
  !!odspResolvedUrl.shareLinkInfo?.sharingLinkToRedeem,
221
220
  0x1ed /* "Share link should be present" */,
@@ -246,34 +245,23 @@ async function redeemSharingLink(
246
245
  });
247
246
  }
248
247
 
249
- const disableUsingTenantDomain = loggerToMonitoringContext(logger).config.getBoolean(
250
- "Fluid.Driver.Odsp.DisableUsingTenantDomainForSharesApi",
251
- );
248
+ const details = JSON.stringify({
249
+ length: redeemUrl?.length,
250
+ shareLinkUrlLength: odspResolvedUrl.shareLinkInfo?.sharingLinkToRedeem.length,
251
+ queryParamsLength: new URL(odspResolvedUrl.shareLinkInfo?.sharingLinkToRedeem).search
252
+ .length,
253
+ useHeaders: true,
254
+ });
252
255
  // There is an issue where if we use the siteUrl in /shares, then the allowed length of url is just a few hundred characters(300-400)
253
- // and we fail to do the redeem. But if we use the tenant domain in the url, then the allowed length becomes 2048. So, first
254
- // construct the url for /shares using tenant domain but to be on safer side, fallback to using the siteUrl. We get tenant domain
255
- // by getting origin of the siteUrl.
256
- if (!disableUsingTenantDomain) {
257
- try {
258
- await callSharesAPI(new URL(odspResolvedUrl.siteUrl).origin);
259
- return;
260
- } catch (error) {
261
- logger.sendTelemetryEvent(
262
- {
263
- eventName: "ShareLinkRedeemFailedWithTenantDomain",
264
- details: JSON.stringify({
265
- length: redeemUrl?.length,
266
- shareLinkUrlLength: odspResolvedUrl.shareLinkInfo?.sharingLinkToRedeem.length,
267
- queryParamsLength: new URL(odspResolvedUrl.shareLinkInfo?.sharingLinkToRedeem)
268
- .search.length,
269
- useHeaders: true,
270
- }),
271
- },
272
- error,
273
- );
274
- }
256
+ // and we fail to do the redeem. But if we use the tenant domain in the url, then the allowed length becomes 2048. So,
257
+ // construct the url for /shares using tenant domain. We get tenant domain by getting origin of the siteUrl.
258
+ try {
259
+ await callSharesAPI(new URL(odspResolvedUrl.siteUrl).origin);
260
+ event.end({ details });
261
+ } catch (error) {
262
+ event.cancel({ details }, error);
263
+ throw error;
275
264
  }
276
- await callSharesAPI(odspResolvedUrl.siteUrl);
277
265
  },
278
266
  );
279
267
  }
@@ -138,6 +138,10 @@ export class OdspDocumentStorageService extends OdspDocumentStorageServiceBase {
138
138
  );
139
139
  const headers = getHeadersWithAuth(authHeader);
140
140
  headers["Content-Type"] = "application/octet-stream";
141
+ if (this.config.getBoolean("Fluid.Driver.Odsp.enableLargeBlobUpload")) {
142
+ // Enable the large blob upload feature
143
+ headers.Prefer = "Increase-Attachment-Size-Limit";
144
+ }
141
145
 
142
146
  return PerformanceEvent.timedExecAsync(
143
147
  this.logger,
@@ -6,4 +6,4 @@
6
6
  */
7
7
 
8
8
  export const pkgName = "@fluidframework/odsp-driver";
9
- export const pkgVersion = "2.41.0";
9
+ export const pkgVersion = "2.42.0";