@fluidframework/odsp-driver 0.56.5 → 0.57.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/dist/createFile.d.ts.map +1 -1
- package/dist/createFile.js +4 -3
- package/dist/createFile.js.map +1 -1
- package/dist/createOdspUrl.d.ts.map +1 -1
- package/dist/createOdspUrl.js.map +1 -1
- package/dist/epochTracker.d.ts.map +1 -1
- package/dist/epochTracker.js +3 -2
- package/dist/epochTracker.js.map +1 -1
- package/dist/fetchSnapshot.d.ts.map +1 -1
- package/dist/fetchSnapshot.js +1 -0
- package/dist/fetchSnapshot.js.map +1 -1
- package/dist/getFileLink.d.ts.map +1 -1
- package/dist/getFileLink.js +3 -2
- package/dist/getFileLink.js.map +1 -1
- package/dist/getQueryString.d.ts.map +1 -1
- package/dist/getQueryString.js.map +1 -1
- package/dist/odspDocumentDeltaConnection.d.ts +6 -6
- package/dist/odspDocumentDeltaConnection.d.ts.map +1 -1
- package/dist/odspDocumentDeltaConnection.js +1 -0
- package/dist/odspDocumentDeltaConnection.js.map +1 -1
- package/dist/odspDocumentService.d.ts.map +1 -1
- package/dist/odspDocumentService.js +3 -2
- package/dist/odspDocumentService.js.map +1 -1
- package/dist/odspDocumentStorageManager.d.ts.map +1 -1
- package/dist/odspDocumentStorageManager.js +7 -6
- package/dist/odspDocumentStorageManager.js.map +1 -1
- package/dist/odspDriverUrlResolverForShareLink.d.ts.map +1 -1
- package/dist/odspDriverUrlResolverForShareLink.js +2 -1
- package/dist/odspDriverUrlResolverForShareLink.js.map +1 -1
- package/dist/odspSummaryUploadManager.d.ts.map +1 -1
- package/dist/odspSummaryUploadManager.js +4 -1
- package/dist/odspSummaryUploadManager.js.map +1 -1
- package/dist/odspUtils.d.ts.map +1 -1
- package/dist/odspUtils.js +6 -6
- package/dist/odspUtils.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/dist/retryUtils.js.map +1 -1
- package/dist/zipItDataRepresentationUtils.d.ts.map +1 -1
- package/dist/zipItDataRepresentationUtils.js +2 -0
- package/dist/zipItDataRepresentationUtils.js.map +1 -1
- package/lib/createFile.d.ts.map +1 -1
- package/lib/createFile.js +4 -3
- package/lib/createFile.js.map +1 -1
- package/lib/createOdspUrl.d.ts.map +1 -1
- package/lib/createOdspUrl.js.map +1 -1
- package/lib/epochTracker.d.ts.map +1 -1
- package/lib/epochTracker.js +3 -2
- package/lib/epochTracker.js.map +1 -1
- package/lib/fetchSnapshot.d.ts.map +1 -1
- package/lib/fetchSnapshot.js +1 -0
- package/lib/fetchSnapshot.js.map +1 -1
- package/lib/getFileLink.d.ts.map +1 -1
- package/lib/getFileLink.js +3 -2
- package/lib/getFileLink.js.map +1 -1
- package/lib/getQueryString.d.ts.map +1 -1
- package/lib/getQueryString.js.map +1 -1
- package/lib/odspDocumentDeltaConnection.d.ts +6 -6
- package/lib/odspDocumentDeltaConnection.d.ts.map +1 -1
- package/lib/odspDocumentDeltaConnection.js +1 -0
- package/lib/odspDocumentDeltaConnection.js.map +1 -1
- package/lib/odspDocumentService.d.ts.map +1 -1
- package/lib/odspDocumentService.js +3 -2
- package/lib/odspDocumentService.js.map +1 -1
- package/lib/odspDocumentStorageManager.d.ts.map +1 -1
- package/lib/odspDocumentStorageManager.js +7 -6
- package/lib/odspDocumentStorageManager.js.map +1 -1
- package/lib/odspDriverUrlResolverForShareLink.d.ts.map +1 -1
- package/lib/odspDriverUrlResolverForShareLink.js +2 -1
- package/lib/odspDriverUrlResolverForShareLink.js.map +1 -1
- package/lib/odspSummaryUploadManager.d.ts.map +1 -1
- package/lib/odspSummaryUploadManager.js +4 -1
- package/lib/odspSummaryUploadManager.js.map +1 -1
- package/lib/odspUtils.d.ts.map +1 -1
- package/lib/odspUtils.js +9 -9
- package/lib/odspUtils.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/lib/retryUtils.js.map +1 -1
- package/lib/zipItDataRepresentationUtils.d.ts.map +1 -1
- package/lib/zipItDataRepresentationUtils.js +2 -0
- package/lib/zipItDataRepresentationUtils.js.map +1 -1
- package/package.json +8 -8
- package/src/createFile.ts +6 -3
- package/src/createOdspUrl.ts +1 -1
- package/src/epochTracker.ts +4 -2
- package/src/fetchSnapshot.ts +7 -6
- package/src/getFileLink.ts +5 -2
- package/src/getQueryString.ts +1 -1
- package/src/odspDocumentDeltaConnection.ts +9 -8
- package/src/odspDocumentService.ts +4 -2
- package/src/odspDocumentStorageManager.ts +12 -8
- package/src/odspDriverUrlResolverForShareLink.ts +3 -1
- package/src/odspSummaryUploadManager.ts +4 -1
- package/src/odspUtils.ts +14 -9
- package/src/packageVersion.ts +1 -1
- package/src/retryUtils.ts +1 -1
- package/src/zipItDataRepresentationUtils.ts +2 -0
|
@@ -44,6 +44,7 @@ import { isOdcOrigin } from "./odspUrlHelper";
|
|
|
44
44
|
import { EpochTracker } from "./epochTracker";
|
|
45
45
|
import { OpsCache } from "./opsCaching";
|
|
46
46
|
import { RetryErrorsStorageAdapter } from "./retryErrorsStorageAdapter";
|
|
47
|
+
import { pkgVersion as driverVersion } from "./packageVersion";
|
|
47
48
|
|
|
48
49
|
/**
|
|
49
50
|
* The DocumentService manages the Socket.IO connection and manages routing requests to connected
|
|
@@ -248,7 +249,7 @@ export class OdspDocumentService implements IDocumentService {
|
|
|
248
249
|
// DeltaManager will recognize this error
|
|
249
250
|
// and load without a delta stream connection.
|
|
250
251
|
this._policies = {...this._policies,storageOnly: true};
|
|
251
|
-
throw new DeltaStreamConnectionForbiddenError(code);
|
|
252
|
+
throw new DeltaStreamConnectionForbiddenError(code, { driverVersion });
|
|
252
253
|
default:
|
|
253
254
|
continue;
|
|
254
255
|
}
|
|
@@ -269,7 +270,8 @@ export class OdspDocumentService implements IDocumentService {
|
|
|
269
270
|
throw new NonRetryableError(
|
|
270
271
|
"pushTokenIsNull",
|
|
271
272
|
"Websocket token is null",
|
|
272
|
-
OdspErrorType.fetchTokenError
|
|
273
|
+
OdspErrorType.fetchTokenError,
|
|
274
|
+
{ driverVersion });
|
|
273
275
|
}
|
|
274
276
|
try {
|
|
275
277
|
const connection = await this.connectToDeltaStreamWithRetry(
|
|
@@ -43,6 +43,7 @@ import {
|
|
|
43
43
|
import { defaultCacheExpiryTimeoutMs, EpochTracker } from "./epochTracker";
|
|
44
44
|
import { OdspSummaryUploadManager } from "./odspSummaryUploadManager";
|
|
45
45
|
import { FlushResult } from "./odspDocumentDeltaConnection";
|
|
46
|
+
import { pkgVersion as driverVersion } from "./packageVersion";
|
|
46
47
|
|
|
47
48
|
/* eslint-disable max-len */
|
|
48
49
|
|
|
@@ -530,13 +531,15 @@ export class OdspDocumentStorageService implements IDocumentStorageService {
|
|
|
530
531
|
throw new NonRetryableError(
|
|
531
532
|
"getVersionsReturnedNoResponse",
|
|
532
533
|
"No response from /versions endpoint",
|
|
533
|
-
DriverErrorType.genericNetworkError
|
|
534
|
+
DriverErrorType.genericNetworkError,
|
|
535
|
+
{ driverVersion });
|
|
534
536
|
}
|
|
535
537
|
if (!Array.isArray(versionsResponse.value)) {
|
|
536
538
|
throw new NonRetryableError(
|
|
537
539
|
"getVersionsReturnedNonArrayResponse",
|
|
538
540
|
"Incorrect response from /versions endpoint",
|
|
539
|
-
DriverErrorType.genericNetworkError
|
|
541
|
+
DriverErrorType.genericNetworkError,
|
|
542
|
+
{ driverVersion });
|
|
540
543
|
}
|
|
541
544
|
return versionsResponse.value.map((version) => {
|
|
542
545
|
// Parse the date from the message
|
|
@@ -692,9 +695,7 @@ export class OdspDocumentStorageService implements IDocumentStorageService {
|
|
|
692
695
|
}
|
|
693
696
|
}
|
|
694
697
|
|
|
695
|
-
const id = await
|
|
696
|
-
{ eventName: "uploadSummaryWithContext" },
|
|
697
|
-
async () => this.odspSummaryUploadManager.writeSummaryTree(summary, context));
|
|
698
|
+
const id = await this.odspSummaryUploadManager.writeSummaryTree(summary, context);
|
|
698
699
|
return id;
|
|
699
700
|
}
|
|
700
701
|
|
|
@@ -715,7 +716,8 @@ export class OdspDocumentStorageService implements IDocumentStorageService {
|
|
|
715
716
|
throw new NonRetryableError(
|
|
716
717
|
"noSnapshotUrlProvided",
|
|
717
718
|
"Method failed because no snapshot url was available",
|
|
718
|
-
DriverErrorType.genericError
|
|
719
|
+
DriverErrorType.genericError,
|
|
720
|
+
{ driverVersion });
|
|
719
721
|
}
|
|
720
722
|
}
|
|
721
723
|
|
|
@@ -724,7 +726,8 @@ export class OdspDocumentStorageService implements IDocumentStorageService {
|
|
|
724
726
|
throw new NonRetryableError(
|
|
725
727
|
"noAttachmentPOSTUrlProvided",
|
|
726
728
|
"Method failed because no attachment POST url was available",
|
|
727
|
-
DriverErrorType.genericError
|
|
729
|
+
DriverErrorType.genericError,
|
|
730
|
+
{ driverVersion });
|
|
728
731
|
}
|
|
729
732
|
}
|
|
730
733
|
|
|
@@ -733,7 +736,8 @@ export class OdspDocumentStorageService implements IDocumentStorageService {
|
|
|
733
736
|
throw new NonRetryableError(
|
|
734
737
|
"noAttachmentGETUrlWasProvided",
|
|
735
738
|
"Method failed because no attachment GET url was available",
|
|
736
|
-
DriverErrorType.genericError
|
|
739
|
+
DriverErrorType.genericError,
|
|
740
|
+
{ driverVersion });
|
|
737
741
|
}
|
|
738
742
|
}
|
|
739
743
|
|
|
@@ -28,6 +28,7 @@ import { createOdspUrl } from "./createOdspUrl";
|
|
|
28
28
|
import { OdspDriverUrlResolver } from "./odspDriverUrlResolver";
|
|
29
29
|
import { getOdspResolvedUrl, createOdspLogger } from "./odspUtils";
|
|
30
30
|
import { getFileLink } from "./getFileLink";
|
|
31
|
+
import { pkgVersion as driverVersion } from "./packageVersion";
|
|
31
32
|
|
|
32
33
|
/**
|
|
33
34
|
* Properties passed to the code responsible for fetching share link for a file.
|
|
@@ -165,7 +166,8 @@ export class OdspDriverUrlResolverForShareLink implements IUrlResolver {
|
|
|
165
166
|
throw new NonRetryableError(
|
|
166
167
|
"shareLinkTokenIsNull",
|
|
167
168
|
"Token callback returned null",
|
|
168
|
-
OdspErrorType.fetchTokenError
|
|
169
|
+
OdspErrorType.fetchTokenError,
|
|
170
|
+
{ driverVersion });
|
|
169
171
|
}
|
|
170
172
|
event.end({ fromCache: isTokenFromCache(tokenResponse) });
|
|
171
173
|
return tokenResponse;
|
|
@@ -46,7 +46,9 @@ export class OdspSummaryUploadManager {
|
|
|
46
46
|
public async writeSummaryTree(tree: api.ISummaryTree, context: ISummaryContext) {
|
|
47
47
|
// If the last proposed handle is not the proposed handle of the acked summary(could happen when the last summary get nacked),
|
|
48
48
|
// then re-initialize the caches with the previous ones else just update the previous caches with the caches from acked summary.
|
|
49
|
-
if
|
|
49
|
+
// Don't bother logging if lastSummaryProposalHandle hasn't been set before; only log on a positive mismatch.
|
|
50
|
+
if (this.lastSummaryProposalHandle !== undefined &&
|
|
51
|
+
this.lastSummaryProposalHandle !== context.proposalHandle) {
|
|
50
52
|
this.mc.logger.sendTelemetryEvent({
|
|
51
53
|
eventName: "LastSummaryProposedHandleMismatch",
|
|
52
54
|
ackedSummaryProposedHandle: context.proposalHandle,
|
|
@@ -106,6 +108,7 @@ export class OdspSummaryUploadManager {
|
|
|
106
108
|
headers: Object.keys(headers).length !== 0 ? true : undefined,
|
|
107
109
|
blobs,
|
|
108
110
|
size: postBody.length,
|
|
111
|
+
referenceSequenceNumber,
|
|
109
112
|
},
|
|
110
113
|
async () => {
|
|
111
114
|
const response = await this.epochTracker.fetchAndParseAsJSON<IWriteSummaryResponse>(
|
package/src/odspUtils.ts
CHANGED
|
@@ -34,7 +34,7 @@ import {
|
|
|
34
34
|
InstrumentedStorageTokenFetcher,
|
|
35
35
|
} from "@fluidframework/odsp-driver-definitions";
|
|
36
36
|
import { fetch } from "./fetch";
|
|
37
|
-
import { pkgVersion } from "./packageVersion";
|
|
37
|
+
import { pkgVersion as driverVersion } from "./packageVersion";
|
|
38
38
|
import { IOdspSnapshot } from "./contracts";
|
|
39
39
|
|
|
40
40
|
export const getWithRetryForTokenRefreshRepeat = "getWithRetryForTokenRefreshRepeat";
|
|
@@ -111,7 +111,8 @@ export async function fetchHelper(
|
|
|
111
111
|
throw new NonRetryableError(
|
|
112
112
|
"odspFetchErrorNoResponse",
|
|
113
113
|
"No response from fetch call",
|
|
114
|
-
DriverErrorType.incorrectServerResponse
|
|
114
|
+
DriverErrorType.incorrectServerResponse,
|
|
115
|
+
{ driverVersion });
|
|
115
116
|
}
|
|
116
117
|
if (!response.ok || response.status < 200 || response.status >= 300) {
|
|
117
118
|
throwOdspNetworkError(
|
|
@@ -136,11 +137,13 @@ export async function fetchHelper(
|
|
|
136
137
|
}
|
|
137
138
|
// This error is thrown by fetch() when AbortSignal is provided and it gets cancelled
|
|
138
139
|
if (error.name === "AbortError") {
|
|
139
|
-
throw new RetryableError(
|
|
140
|
+
throw new RetryableError(
|
|
141
|
+
"fetchAbort", "Fetch Timeout (AbortError)", OdspErrorType.fetchTimeout, { driverVersion });
|
|
140
142
|
}
|
|
141
143
|
// TCP/IP timeout
|
|
142
144
|
if (errorText.indexOf("ETIMEDOUT") !== -1) {
|
|
143
|
-
throw new RetryableError(
|
|
145
|
+
throw new RetryableError(
|
|
146
|
+
"fetchETimedout", "Fetch Timeout (ETIMEDOUT)", OdspErrorType.fetchTimeout, { driverVersion });
|
|
144
147
|
}
|
|
145
148
|
|
|
146
149
|
//
|
|
@@ -149,9 +152,11 @@ export async function fetchHelper(
|
|
|
149
152
|
// It is also non-serializable object due to circular references.
|
|
150
153
|
//
|
|
151
154
|
if (online === OnlineStatus.Offline) {
|
|
152
|
-
throw new RetryableError(
|
|
155
|
+
throw new RetryableError(
|
|
156
|
+
"OdspFetchOffline", `Offline: ${errorText}`, DriverErrorType.offlineError, { driverVersion });
|
|
153
157
|
} else {
|
|
154
|
-
throw new RetryableError(
|
|
158
|
+
throw new RetryableError(
|
|
159
|
+
"OdspFetchError", `Fetch error: ${errorText}`, DriverErrorType.fetchFailure, { driverVersion });
|
|
155
160
|
}
|
|
156
161
|
});
|
|
157
162
|
}
|
|
@@ -238,7 +243,7 @@ export const createOdspLogger = (logger?: ITelemetryBaseLogger) =>
|
|
|
238
243
|
"OdspDriver",
|
|
239
244
|
{ all :
|
|
240
245
|
{
|
|
241
|
-
driverVersion
|
|
246
|
+
driverVersion,
|
|
242
247
|
},
|
|
243
248
|
});
|
|
244
249
|
|
|
@@ -304,7 +309,7 @@ export function toInstrumentedOdspTokenFetcher(
|
|
|
304
309
|
"storageTokenIsNull",
|
|
305
310
|
`Token is null for ${name} call`,
|
|
306
311
|
OdspErrorType.fetchTokenError,
|
|
307
|
-
{ method: name });
|
|
312
|
+
{ method: name, driverVersion });
|
|
308
313
|
}
|
|
309
314
|
return token;
|
|
310
315
|
}, (error) => {
|
|
@@ -318,7 +323,7 @@ export function toInstrumentedOdspTokenFetcher(
|
|
|
318
323
|
errorMessage,
|
|
319
324
|
OdspErrorType.fetchTokenError,
|
|
320
325
|
typeof rawCanRetry === "boolean" ? rawCanRetry : false /* canRetry */,
|
|
321
|
-
{ method: name, driverVersion
|
|
326
|
+
{ method: name, driverVersion }));
|
|
322
327
|
throw tokenError;
|
|
323
328
|
}),
|
|
324
329
|
{ cancel: "generic" });
|
package/src/packageVersion.ts
CHANGED
package/src/retryUtils.ts
CHANGED
|
@@ -68,7 +68,7 @@ export async function runWithRetry<T>(
|
|
|
68
68
|
|
|
69
69
|
assert(canRetry, 0x24d /* "can retry" */);
|
|
70
70
|
await delay(Math.floor(retryAfter));
|
|
71
|
-
retryAfter += retryAfter / 4
|
|
71
|
+
retryAfter += retryAfter / 4 * (1 + Math.random());
|
|
72
72
|
lastError = error;
|
|
73
73
|
}
|
|
74
74
|
}
|
|
@@ -12,6 +12,7 @@ import { assert, IsoBuffer, Uint8ArrayToArrayBuffer, Uint8ArrayToString } from "
|
|
|
12
12
|
import { NonRetryableError } from "@fluidframework/driver-utils";
|
|
13
13
|
import { DriverErrorType } from "@fluidframework/driver-definitions";
|
|
14
14
|
import { ReadBuffer } from "./ReadBufferUtils";
|
|
15
|
+
import { pkgVersion as driverVersion } from "./packageVersion";
|
|
15
16
|
|
|
16
17
|
// eslint-disable-next-line max-len
|
|
17
18
|
// https://onedrive.visualstudio.com/SharePoint%20Online/_git/SPO?path=/cobalt/Base/Property/BinaryEncodedPropertyReader.cs&version=GBmaster&_a=contents
|
|
@@ -485,6 +486,7 @@ function throwBufferParseException(
|
|
|
485
486
|
{
|
|
486
487
|
nodeType: getNodeType(node),
|
|
487
488
|
expectedNodeType,
|
|
489
|
+
driverVersion,
|
|
488
490
|
});
|
|
489
491
|
}
|
|
490
492
|
|