@fluidframework/odsp-driver 0.57.2 → 0.58.1000
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/contracts.d.ts +4 -0
- package/dist/contracts.d.ts.map +1 -1
- package/dist/contracts.js.map +1 -1
- package/dist/createFile.d.ts.map +1 -1
- package/dist/createFile.js +3 -3
- package/dist/createFile.js.map +1 -1
- package/dist/epochTracker.d.ts.map +1 -1
- package/dist/epochTracker.js +2 -3
- package/dist/epochTracker.js.map +1 -1
- package/dist/fetchSnapshot.d.ts.map +1 -1
- package/dist/fetchSnapshot.js +66 -25
- package/dist/fetchSnapshot.js.map +1 -1
- package/dist/getFileLink.js +2 -2
- package/dist/getFileLink.js.map +1 -1
- package/dist/odspCache.d.ts +8 -3
- package/dist/odspCache.d.ts.map +1 -1
- package/dist/odspCache.js +1 -1
- package/dist/odspCache.js.map +1 -1
- package/dist/odspDocumentDeltaConnection.js +1 -1
- package/dist/odspDocumentDeltaConnection.js.map +1 -1
- package/dist/odspDocumentService.d.ts +5 -0
- package/dist/odspDocumentService.d.ts.map +1 -1
- package/dist/odspDocumentService.js +88 -25
- package/dist/odspDocumentService.js.map +1 -1
- package/dist/odspDocumentStorageManager.d.ts.map +1 -1
- package/dist/odspDocumentStorageManager.js +5 -5
- package/dist/odspDocumentStorageManager.js.map +1 -1
- package/dist/odspDriverUrlResolver.d.ts +2 -2
- package/dist/odspDriverUrlResolver.d.ts.map +1 -1
- package/dist/odspDriverUrlResolver.js +14 -3
- package/dist/odspDriverUrlResolver.js.map +1 -1
- package/dist/odspDriverUrlResolverForShareLink.d.ts +2 -2
- package/dist/odspDriverUrlResolverForShareLink.d.ts.map +1 -1
- package/dist/odspDriverUrlResolverForShareLink.js +15 -4
- package/dist/odspDriverUrlResolverForShareLink.js.map +1 -1
- package/dist/odspError.d.ts.map +1 -1
- package/dist/odspError.js +2 -2
- package/dist/odspError.js.map +1 -1
- package/dist/odspUtils.d.ts.map +1 -1
- package/dist/odspUtils.js +10 -10
- package/dist/odspUtils.js.map +1 -1
- package/dist/packageVersion.d.ts +1 -1
- package/dist/packageVersion.d.ts.map +1 -1
- package/dist/packageVersion.js +1 -1
- package/dist/packageVersion.js.map +1 -1
- package/dist/retryErrorsStorageAdapter.js +1 -1
- package/dist/retryErrorsStorageAdapter.js.map +1 -1
- package/dist/vroom.d.ts +2 -1
- package/dist/vroom.d.ts.map +1 -1
- package/dist/vroom.js +6 -2
- package/dist/vroom.js.map +1 -1
- package/dist/zipItDataRepresentationUtils.js +1 -1
- package/dist/zipItDataRepresentationUtils.js.map +1 -1
- package/lib/contracts.d.ts +4 -0
- package/lib/contracts.d.ts.map +1 -1
- package/lib/contracts.js.map +1 -1
- package/lib/createFile.d.ts.map +1 -1
- package/lib/createFile.js +3 -3
- package/lib/createFile.js.map +1 -1
- package/lib/epochTracker.d.ts.map +1 -1
- package/lib/epochTracker.js +2 -3
- package/lib/epochTracker.js.map +1 -1
- package/lib/fetchSnapshot.d.ts.map +1 -1
- package/lib/fetchSnapshot.js +66 -25
- package/lib/fetchSnapshot.js.map +1 -1
- package/lib/getFileLink.js +2 -2
- package/lib/getFileLink.js.map +1 -1
- package/lib/odspCache.d.ts +8 -3
- package/lib/odspCache.d.ts.map +1 -1
- package/lib/odspCache.js +1 -1
- package/lib/odspCache.js.map +1 -1
- package/lib/odspDocumentDeltaConnection.js +1 -1
- package/lib/odspDocumentDeltaConnection.js.map +1 -1
- package/lib/odspDocumentService.d.ts +5 -0
- package/lib/odspDocumentService.d.ts.map +1 -1
- package/lib/odspDocumentService.js +88 -25
- package/lib/odspDocumentService.js.map +1 -1
- package/lib/odspDocumentStorageManager.d.ts.map +1 -1
- package/lib/odspDocumentStorageManager.js +5 -5
- package/lib/odspDocumentStorageManager.js.map +1 -1
- package/lib/odspDriverUrlResolver.d.ts +2 -2
- package/lib/odspDriverUrlResolver.d.ts.map +1 -1
- package/lib/odspDriverUrlResolver.js +15 -4
- package/lib/odspDriverUrlResolver.js.map +1 -1
- package/lib/odspDriverUrlResolverForShareLink.d.ts +2 -2
- package/lib/odspDriverUrlResolverForShareLink.d.ts.map +1 -1
- package/lib/odspDriverUrlResolverForShareLink.js +15 -4
- package/lib/odspDriverUrlResolverForShareLink.js.map +1 -1
- package/lib/odspError.d.ts.map +1 -1
- package/lib/odspError.js +2 -2
- package/lib/odspError.js.map +1 -1
- package/lib/odspUtils.d.ts.map +1 -1
- package/lib/odspUtils.js +10 -10
- package/lib/odspUtils.js.map +1 -1
- package/lib/packageVersion.d.ts +1 -1
- package/lib/packageVersion.d.ts.map +1 -1
- package/lib/packageVersion.js +1 -1
- package/lib/packageVersion.js.map +1 -1
- package/lib/retryErrorsStorageAdapter.js +1 -1
- package/lib/retryErrorsStorageAdapter.js.map +1 -1
- package/lib/vroom.d.ts +2 -1
- package/lib/vroom.d.ts.map +1 -1
- package/lib/vroom.js +6 -2
- package/lib/vroom.js.map +1 -1
- package/lib/zipItDataRepresentationUtils.js +1 -1
- package/lib/zipItDataRepresentationUtils.js.map +1 -1
- package/package.json +12 -12
- package/src/contracts.ts +5 -0
- package/src/createFile.ts +2 -4
- package/src/epochTracker.ts +5 -4
- package/src/fetchSnapshot.ts +66 -33
- package/src/getFileLink.ts +0 -2
- package/src/odspCache.ts +3 -3
- package/src/odspDocumentDeltaConnection.ts +1 -1
- package/src/odspDocumentService.ts +110 -28
- package/src/odspDocumentStorageManager.ts +1 -6
- package/src/odspDriverUrlResolver.ts +18 -5
- package/src/odspDriverUrlResolverForShareLink.ts +17 -9
- package/src/odspError.ts +1 -2
- package/src/odspUtils.ts +10 -13
- package/src/packageVersion.ts +1 -1
- package/src/retryErrorsStorageAdapter.ts +1 -1
- package/src/vroom.ts +6 -0
- package/src/zipItDataRepresentationUtils.ts +1 -2
package/src/odspUtils.ts
CHANGED
|
@@ -109,14 +109,13 @@ export async function fetchHelper(
|
|
|
109
109
|
// Let's assume we can retry.
|
|
110
110
|
if (!response) {
|
|
111
111
|
throw new NonRetryableError(
|
|
112
|
-
"
|
|
113
|
-
"No response from fetch call",
|
|
112
|
+
"No response from ODSP fetch call",
|
|
114
113
|
DriverErrorType.incorrectServerResponse,
|
|
115
114
|
{ driverVersion });
|
|
116
115
|
}
|
|
117
116
|
if (!response.ok || response.status < 200 || response.status >= 300) {
|
|
118
117
|
throwOdspNetworkError(
|
|
119
|
-
`
|
|
118
|
+
`ODSP fetch error [${response.status}]`, response.status, response, await response.text());
|
|
120
119
|
}
|
|
121
120
|
|
|
122
121
|
const headers = headersToMap(response.headers);
|
|
@@ -138,25 +137,25 @@ export async function fetchHelper(
|
|
|
138
137
|
// This error is thrown by fetch() when AbortSignal is provided and it gets cancelled
|
|
139
138
|
if (error.name === "AbortError") {
|
|
140
139
|
throw new RetryableError(
|
|
141
|
-
"
|
|
140
|
+
"Fetch Timeout (AbortError)", OdspErrorType.fetchTimeout, { driverVersion });
|
|
142
141
|
}
|
|
143
142
|
// TCP/IP timeout
|
|
144
143
|
if (errorText.indexOf("ETIMEDOUT") !== -1) {
|
|
145
144
|
throw new RetryableError(
|
|
146
|
-
"
|
|
145
|
+
"Fetch Timeout (ETIMEDOUT)", OdspErrorType.fetchTimeout, { driverVersion });
|
|
147
146
|
}
|
|
148
147
|
|
|
149
148
|
//
|
|
150
149
|
// WARNING: Do not log error object itself or any of its properties!
|
|
151
|
-
// It could
|
|
150
|
+
// It could contain PII, like URI in message itself, or token in properties.
|
|
152
151
|
// It is also non-serializable object due to circular references.
|
|
153
152
|
//
|
|
154
153
|
if (online === OnlineStatus.Offline) {
|
|
155
154
|
throw new RetryableError(
|
|
156
|
-
|
|
155
|
+
`ODSP fetch failure (Offline): ${errorText}`, DriverErrorType.offlineError, { driverVersion });
|
|
157
156
|
} else {
|
|
158
157
|
throw new RetryableError(
|
|
159
|
-
|
|
158
|
+
`ODSP fetch failure: ${errorText}`, DriverErrorType.fetchFailure, { driverVersion });
|
|
160
159
|
}
|
|
161
160
|
});
|
|
162
161
|
}
|
|
@@ -202,7 +201,7 @@ export async function fetchAndParseAsJSONHelper<T>(
|
|
|
202
201
|
// succeeds on retry.
|
|
203
202
|
// So do not log error object itself.
|
|
204
203
|
throwOdspNetworkError(
|
|
205
|
-
"
|
|
204
|
+
"Error while parsing fetch response",
|
|
206
205
|
fetchIncorrectResponse,
|
|
207
206
|
content, // response
|
|
208
207
|
text,
|
|
@@ -306,8 +305,7 @@ export function toInstrumentedOdspTokenFetcher(
|
|
|
306
305
|
}
|
|
307
306
|
if (token === null && throwOnNullToken) {
|
|
308
307
|
throw new NonRetryableError(
|
|
309
|
-
|
|
310
|
-
`Token is null for ${name} call`,
|
|
308
|
+
`The Host-provided token fetcher for ${name} call returned null`,
|
|
311
309
|
OdspErrorType.fetchTokenError,
|
|
312
310
|
{ method: name, driverVersion });
|
|
313
311
|
}
|
|
@@ -319,8 +317,7 @@ export function toInstrumentedOdspTokenFetcher(
|
|
|
319
317
|
const tokenError = wrapError(
|
|
320
318
|
error,
|
|
321
319
|
(errorMessage) => new NetworkErrorBasic(
|
|
322
|
-
|
|
323
|
-
errorMessage,
|
|
320
|
+
`The Host-provided token fetcher for ${name} call threw an error: ${errorMessage}`,
|
|
324
321
|
OdspErrorType.fetchTokenError,
|
|
325
322
|
typeof rawCanRetry === "boolean" ? rawCanRetry : false /* canRetry */,
|
|
326
323
|
{ method: name, driverVersion }));
|
package/src/packageVersion.ts
CHANGED
|
@@ -92,7 +92,7 @@ export class RetryErrorsStorageAdapter implements IDocumentStorageService, IDisp
|
|
|
92
92
|
|
|
93
93
|
private checkStorageDisposed() {
|
|
94
94
|
if (this._disposed) {
|
|
95
|
-
throw new LoggingError("
|
|
95
|
+
throw new LoggingError("Storage Service is disposed. Cannot retry", { canRetry: false });
|
|
96
96
|
}
|
|
97
97
|
}
|
|
98
98
|
|
package/src/vroom.ts
CHANGED
|
@@ -29,6 +29,7 @@ interface IJoinSessionBody {
|
|
|
29
29
|
* @param requestSocketToken - flag indicating whether joinSession is expected to return access token
|
|
30
30
|
* which is used when establishing websocket connection with collab session backend service.
|
|
31
31
|
* @param options - Options to fetch the token.
|
|
32
|
+
* @param disableJoinSessionRefresh - Whether the caller wants to disable refreshing join session periodically.
|
|
32
33
|
* @param guestDisplayName - display name used to identify guest user joining a session.
|
|
33
34
|
* This is optional and used only when collab session is being joined via invite.
|
|
34
35
|
*/
|
|
@@ -41,6 +42,7 @@ export async function fetchJoinSession(
|
|
|
41
42
|
epochTracker: EpochTracker,
|
|
42
43
|
requestSocketToken: boolean,
|
|
43
44
|
options: TokenFetchOptionsEx,
|
|
45
|
+
disableJoinSessionRefresh: boolean | undefined,
|
|
44
46
|
guestDisplayName?: string,
|
|
45
47
|
): Promise<ISocketStorageDiscovery> {
|
|
46
48
|
const token = await getStorageToken(options, "JoinSession");
|
|
@@ -61,6 +63,9 @@ export async function fetchJoinSession(
|
|
|
61
63
|
postBody += `Authorization: Bearer ${token}\r\n`;
|
|
62
64
|
postBody += `X-HTTP-Method-Override: POST\r\n`;
|
|
63
65
|
postBody += `Content-Type: application/json\r\n`;
|
|
66
|
+
if (!disableJoinSessionRefresh) {
|
|
67
|
+
postBody += `prefer: FluidRemoveCheckAccess\r\n`;
|
|
68
|
+
}
|
|
64
69
|
postBody += `_post: 1\r\n`;
|
|
65
70
|
// Name should be there when socket token is requested and vice-versa.
|
|
66
71
|
if (requestSocketToken && guestDisplayName !== undefined) {
|
|
@@ -98,6 +103,7 @@ export async function fetchJoinSession(
|
|
|
98
103
|
// pushV2 websocket urls will contain pushf
|
|
99
104
|
pushv2: socketUrl.includes("pushf"),
|
|
100
105
|
webSocketHostName,
|
|
106
|
+
refreshSessionDurationSeconds: response.content.refreshSessionDurationSeconds,
|
|
101
107
|
});
|
|
102
108
|
|
|
103
109
|
if (response.content.runtimeTenantId && !response.content.tenantId) {
|
|
@@ -480,8 +480,7 @@ function throwBufferParseException(
|
|
|
480
480
|
message: string,
|
|
481
481
|
): never {
|
|
482
482
|
throw new NonRetryableError(
|
|
483
|
-
|
|
484
|
-
message,
|
|
483
|
+
`Buffer parsing exception: ${message}`,
|
|
485
484
|
DriverErrorType.incorrectServerResponse,
|
|
486
485
|
{
|
|
487
486
|
nodeType: getNodeType(node),
|