@fluidframework/odsp-driver 0.59.3003 → 0.59.4000
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/WriteBufferUtils.js +1 -1
- package/dist/WriteBufferUtils.js.map +1 -1
- package/dist/createFile.d.ts +1 -1
- package/dist/createFile.d.ts.map +1 -1
- package/dist/createFile.js +36 -6
- package/dist/createFile.js.map +1 -1
- package/dist/fetchSnapshot.d.ts.map +1 -1
- package/dist/fetchSnapshot.js +2 -4
- package/dist/fetchSnapshot.js.map +1 -1
- package/dist/odspDocumentDeltaConnection.d.ts.map +1 -1
- package/dist/odspDocumentDeltaConnection.js +15 -2
- package/dist/odspDocumentDeltaConnection.js.map +1 -1
- package/dist/odspDocumentServiceFactoryCore.d.ts.map +1 -1
- package/dist/odspDocumentServiceFactoryCore.js +5 -1
- package/dist/odspDocumentServiceFactoryCore.js.map +1 -1
- package/dist/odspSnapshotParser.js +1 -1
- package/dist/odspSnapshotParser.js.map +1 -1
- package/dist/odspUtils.d.ts +1 -0
- package/dist/odspUtils.d.ts.map +1 -1
- package/dist/odspUtils.js +8 -9
- 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/prefetchLatestSnapshot.d.ts.map +1 -1
- package/dist/prefetchLatestSnapshot.js +1 -1
- package/dist/prefetchLatestSnapshot.js.map +1 -1
- package/dist/zipItDataRepresentationUtils.js +2 -2
- package/dist/zipItDataRepresentationUtils.js.map +1 -1
- package/lib/WriteBufferUtils.js +1 -1
- package/lib/WriteBufferUtils.js.map +1 -1
- package/lib/createFile.d.ts +1 -1
- package/lib/createFile.d.ts.map +1 -1
- package/lib/createFile.js +37 -7
- package/lib/createFile.js.map +1 -1
- package/lib/fetchSnapshot.d.ts.map +1 -1
- package/lib/fetchSnapshot.js +2 -4
- package/lib/fetchSnapshot.js.map +1 -1
- package/lib/odspDocumentDeltaConnection.d.ts.map +1 -1
- package/lib/odspDocumentDeltaConnection.js +15 -2
- package/lib/odspDocumentDeltaConnection.js.map +1 -1
- package/lib/odspDocumentServiceFactoryCore.d.ts.map +1 -1
- package/lib/odspDocumentServiceFactoryCore.js +5 -1
- package/lib/odspDocumentServiceFactoryCore.js.map +1 -1
- package/lib/odspSnapshotParser.js +1 -1
- package/lib/odspSnapshotParser.js.map +1 -1
- package/lib/odspUtils.d.ts +1 -0
- package/lib/odspUtils.d.ts.map +1 -1
- package/lib/odspUtils.js +7 -8
- 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/prefetchLatestSnapshot.d.ts.map +1 -1
- package/lib/prefetchLatestSnapshot.js +1 -1
- package/lib/prefetchLatestSnapshot.js.map +1 -1
- package/lib/zipItDataRepresentationUtils.js +2 -2
- package/lib/zipItDataRepresentationUtils.js.map +1 -1
- package/package.json +17 -15
- package/src/WriteBufferUtils.ts +1 -1
- package/src/createFile.ts +41 -5
- package/src/fetchSnapshot.ts +2 -4
- package/src/odspDocumentDeltaConnection.ts +14 -2
- package/src/odspDocumentServiceFactoryCore.ts +7 -0
- package/src/odspSnapshotParser.ts +1 -1
- package/src/odspUtils.ts +9 -8
- package/src/packageVersion.ts +1 -1
- package/src/prefetchLatestSnapshot.ts +1 -1
- package/src/zipItDataRepresentationUtils.ts +2 -2
|
@@ -440,6 +440,7 @@ export class OdspDocumentDeltaConnection extends DocumentDeltaConnection {
|
|
|
440
440
|
}
|
|
441
441
|
|
|
442
442
|
protected serverDisconnectHandler = (error: IFluidErrorBase & OdspError) => {
|
|
443
|
+
this.logger.sendTelemetryEvent({ eventName: "ServerDisconnect" }, error);
|
|
443
444
|
this.disposeCore(true, error);
|
|
444
445
|
};
|
|
445
446
|
|
|
@@ -551,11 +552,22 @@ export class OdspDocumentDeltaConnection extends DocumentDeltaConnection {
|
|
|
551
552
|
|
|
552
553
|
case "nack":
|
|
553
554
|
// per client / document nack handling
|
|
554
|
-
super.addTrackedListener(event, (clientIdOrDocumentId: string,
|
|
555
|
+
super.addTrackedListener(event, (clientIdOrDocumentId: string, nacks: INack[]) => {
|
|
555
556
|
if (clientIdOrDocumentId.length === 0 ||
|
|
556
557
|
clientIdOrDocumentId === this.documentId ||
|
|
557
558
|
(this.hasDetails && clientIdOrDocumentId === this.clientId)) {
|
|
558
|
-
|
|
559
|
+
const nackContent = nacks[0]?.content;
|
|
560
|
+
if (nackContent !== undefined) {
|
|
561
|
+
const { code, type, message, retryAfter } = nackContent;
|
|
562
|
+
this.logger.sendTelemetryEvent({
|
|
563
|
+
eventName: "ServerNack",
|
|
564
|
+
code,
|
|
565
|
+
type,
|
|
566
|
+
message,
|
|
567
|
+
retryAfterSeconds: retryAfter,
|
|
568
|
+
});
|
|
569
|
+
}
|
|
570
|
+
this.emit("nack", clientIdOrDocumentId, nacks);
|
|
559
571
|
}
|
|
560
572
|
});
|
|
561
573
|
break;
|
|
@@ -125,6 +125,7 @@ export class OdspDocumentServiceFactoryCore implements IDocumentServiceFactory {
|
|
|
125
125
|
fileEntry,
|
|
126
126
|
this.hostPolicy.cacheCreateNewSummary ?? true,
|
|
127
127
|
!!this.hostPolicy.sessionOptions?.forceAccessTokenViaAuthorizationHeader,
|
|
128
|
+
odspResolvedUrl.isClpCompliantApp,
|
|
128
129
|
);
|
|
129
130
|
const docService = this.createDocumentServiceCore(odspResolvedUrl, odspLogger,
|
|
130
131
|
cacheAndTracker, clientIsSummarizer);
|
|
@@ -156,6 +157,12 @@ export class OdspDocumentServiceFactoryCore implements IDocumentServiceFactory {
|
|
|
156
157
|
// create the key to separate the socket reuse cache
|
|
157
158
|
this.socketReferenceKeyPrefix = uuid();
|
|
158
159
|
}
|
|
160
|
+
// Set enableRedeemFallback by default as true.
|
|
161
|
+
this.hostPolicy.enableRedeemFallback = this.hostPolicy.enableRedeemFallback ?? true;
|
|
162
|
+
this.hostPolicy.sessionOptions = {
|
|
163
|
+
forceAccessTokenViaAuthorizationHeader: true,
|
|
164
|
+
...this.hostPolicy.sessionOptions,
|
|
165
|
+
};
|
|
159
166
|
}
|
|
160
167
|
|
|
161
168
|
public async createDocumentService(
|
|
@@ -58,7 +58,7 @@ export function convertOdspSnapshotToSnapsohtTreeAndBlobs(
|
|
|
58
58
|
if (odspSnapshot.blobs) {
|
|
59
59
|
odspSnapshot.blobs.forEach((blob) => {
|
|
60
60
|
assert(blob.encoding === "base64" || blob.encoding === undefined,
|
|
61
|
-
0x0a4 /*
|
|
61
|
+
0x0a4 /* Unexpected blob encoding type */);
|
|
62
62
|
blobsWithBufferContent.set(blob.id, stringToBuffer(blob.content, blob.encoding ?? "utf8"));
|
|
63
63
|
});
|
|
64
64
|
}
|
package/src/odspUtils.ts
CHANGED
|
@@ -129,21 +129,16 @@ export async function fetchHelper(
|
|
|
129
129
|
duration: performance.now() - start,
|
|
130
130
|
};
|
|
131
131
|
}, (error) => {
|
|
132
|
-
|
|
133
|
-
// is pretty good indicator we are offline. Treating it as offline scenario will make it
|
|
134
|
-
// easier to see other errors in telemetry.
|
|
135
|
-
let online = isOnline();
|
|
132
|
+
const online = isOnline();
|
|
136
133
|
const errorText = `${error}`;
|
|
137
|
-
|
|
138
|
-
online = OnlineStatus.Offline;
|
|
139
|
-
}
|
|
134
|
+
|
|
140
135
|
// This error is thrown by fetch() when AbortSignal is provided and it gets cancelled
|
|
141
136
|
if (error.name === "AbortError") {
|
|
142
137
|
throw new RetryableError(
|
|
143
138
|
"Fetch Timeout (AbortError)", OdspErrorType.fetchTimeout, { driverVersion });
|
|
144
139
|
}
|
|
145
140
|
// TCP/IP timeout
|
|
146
|
-
if (errorText.
|
|
141
|
+
if (errorText.includes("ETIMEDOUT")) {
|
|
147
142
|
throw new RetryableError(
|
|
148
143
|
"Fetch Timeout (ETIMEDOUT)", OdspErrorType.fetchTimeout, { driverVersion });
|
|
149
144
|
}
|
|
@@ -158,6 +153,8 @@ export async function fetchHelper(
|
|
|
158
153
|
// pre-0.58 error message prefix: Offline
|
|
159
154
|
`ODSP fetch failure (Offline): ${errorText}`, DriverErrorType.offlineError, { driverVersion });
|
|
160
155
|
} else {
|
|
156
|
+
// It is perhaps still possible that this is due to being offline, the error does not reveal enough
|
|
157
|
+
// information to conclude. Could also be DNS errors, malformed fetch request, CSP violation, etc.
|
|
161
158
|
throw new RetryableError(
|
|
162
159
|
// pre-0.58 error message prefix: Fetch error
|
|
163
160
|
`ODSP fetch failure: ${errorText}`, DriverErrorType.fetchFailure, { driverVersion });
|
|
@@ -343,3 +340,7 @@ export function createCacheSnapshotKey(odspResolvedUrl: IOdspResolvedUrl): ICach
|
|
|
343
340
|
};
|
|
344
341
|
return cacheEntry;
|
|
345
342
|
}
|
|
343
|
+
|
|
344
|
+
// 80KB is the max body size that we can put in ump post body for server to be able to accept it.
|
|
345
|
+
// Keeping it 78KB to be a little cautious. As per the telemetry 99p is less than 78KB.
|
|
346
|
+
export const maxUmpPostBodySize = 79872;
|
package/src/packageVersion.ts
CHANGED
|
@@ -50,7 +50,7 @@ export async function prefetchLatestSnapshot(
|
|
|
50
50
|
forceAccessTokenViaAuthorizationHeader: boolean,
|
|
51
51
|
logger: ITelemetryBaseLogger,
|
|
52
52
|
hostSnapshotFetchOptions: ISnapshotOptions | undefined,
|
|
53
|
-
enableRedeemFallback
|
|
53
|
+
enableRedeemFallback: boolean = true,
|
|
54
54
|
fetchBinarySnapshotFormat?: boolean,
|
|
55
55
|
snapshotFormatFetchType?: SnapshotFormatSupportType,
|
|
56
56
|
): Promise<boolean> {
|
|
@@ -107,7 +107,7 @@ export const codeToBytesMap = {
|
|
|
107
107
|
|
|
108
108
|
export function getValueSafely(map: { [index: number]: number; }, key: number) {
|
|
109
109
|
const val = map[key];
|
|
110
|
-
assert(val !== undefined, 0x287 /*
|
|
110
|
+
assert(val !== undefined, 0x287 /* key must exist in the map */);
|
|
111
111
|
return val;
|
|
112
112
|
}
|
|
113
113
|
|
|
@@ -123,7 +123,7 @@ export function getAndValidateNodeProps(node: NodeCore, props: string[], enforce
|
|
|
123
123
|
}
|
|
124
124
|
}
|
|
125
125
|
if (enforceAllProps) {
|
|
126
|
-
assert(propSet.size === 0, 0x288 /*
|
|
126
|
+
assert(propSet.size === 0, 0x288 /* All properties should exist */);
|
|
127
127
|
}
|
|
128
128
|
return res;
|
|
129
129
|
}
|