@fluidframework/container-runtime 2.0.0-internal.5.4.2 → 2.0.0-internal.6.0.1
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/CHANGELOG.md +71 -0
- package/dist/batchTracker.d.ts +2 -1
- package/dist/batchTracker.d.ts.map +1 -1
- package/dist/batchTracker.js.map +1 -1
- package/dist/blobManager.d.ts +4 -1
- package/dist/blobManager.d.ts.map +1 -1
- package/dist/blobManager.js +61 -26
- package/dist/blobManager.js.map +1 -1
- package/dist/connectionTelemetry.js +10 -2
- package/dist/connectionTelemetry.js.map +1 -1
- package/dist/containerRuntime.d.ts +26 -11
- package/dist/containerRuntime.d.ts.map +1 -1
- package/dist/containerRuntime.js +177 -123
- package/dist/containerRuntime.js.map +1 -1
- package/dist/dataStore.js +8 -2
- package/dist/dataStore.js.map +1 -1
- package/dist/dataStoreContext.js +23 -24
- package/dist/dataStoreContext.js.map +1 -1
- package/dist/dataStores.d.ts +20 -4
- package/dist/dataStores.d.ts.map +1 -1
- package/dist/dataStores.js +107 -53
- package/dist/dataStores.js.map +1 -1
- package/dist/gc/garbageCollection.js +17 -20
- package/dist/gc/garbageCollection.js.map +1 -1
- package/dist/gc/gcConfigs.js +13 -11
- package/dist/gc/gcConfigs.js.map +1 -1
- package/dist/gc/gcHelpers.js +4 -6
- package/dist/gc/gcHelpers.js.map +1 -1
- package/dist/gc/gcSummaryStateTracker.js +4 -6
- package/dist/gc/gcSummaryStateTracker.js.map +1 -1
- package/dist/gc/gcTelemetry.d.ts.map +1 -1
- package/dist/gc/gcTelemetry.js +55 -37
- package/dist/gc/gcTelemetry.js.map +1 -1
- package/dist/id-compressor/idCompressor.js +49 -51
- package/dist/id-compressor/idCompressor.js.map +1 -1
- package/dist/id-compressor/idRange.js +2 -2
- package/dist/id-compressor/idRange.js.map +1 -1
- package/dist/id-compressor/sessionIdNormalizer.js +11 -16
- package/dist/id-compressor/sessionIdNormalizer.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/opLifecycle/batchManager.js +10 -6
- package/dist/opLifecycle/batchManager.js.map +1 -1
- package/dist/opLifecycle/opCompressor.js +6 -1
- package/dist/opLifecycle/opCompressor.js.map +1 -1
- package/dist/opLifecycle/opDecompressor.js +11 -9
- package/dist/opLifecycle/opDecompressor.js.map +1 -1
- package/dist/opLifecycle/opGroupingManager.js +13 -5
- package/dist/opLifecycle/opGroupingManager.js.map +1 -1
- package/dist/opLifecycle/opSplitter.js +10 -6
- package/dist/opLifecycle/opSplitter.js.map +1 -1
- package/dist/opLifecycle/outbox.js +1 -2
- package/dist/opLifecycle/outbox.js.map +1 -1
- package/dist/opLifecycle/remoteMessageProcessor.js +1 -1
- package/dist/opLifecycle/remoteMessageProcessor.js.map +1 -1
- package/dist/opProperties.js +1 -2
- package/dist/opProperties.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/pendingStateManager.d.ts +2 -2
- package/dist/pendingStateManager.d.ts.map +1 -1
- package/dist/pendingStateManager.js +22 -22
- package/dist/pendingStateManager.js.map +1 -1
- package/dist/scheduleManager.js +14 -10
- package/dist/scheduleManager.js.map +1 -1
- package/dist/summary/orderedClientElection.d.ts +2 -1
- package/dist/summary/orderedClientElection.d.ts.map +1 -1
- package/dist/summary/orderedClientElection.js +17 -18
- package/dist/summary/orderedClientElection.js.map +1 -1
- package/dist/summary/runningSummarizer.js +32 -38
- package/dist/summary/runningSummarizer.js.map +1 -1
- package/dist/summary/summarizer.js +4 -7
- package/dist/summary/summarizer.js.map +1 -1
- package/dist/summary/summarizerClientElection.js +5 -9
- package/dist/summary/summarizerClientElection.js.map +1 -1
- package/dist/summary/summarizerHeuristics.js +8 -12
- package/dist/summary/summarizerHeuristics.js.map +1 -1
- package/dist/summary/summarizerNode/summarizerNode.js +22 -15
- package/dist/summary/summarizerNode/summarizerNode.js.map +1 -1
- package/dist/summary/summarizerNode/summarizerNodeUtils.js +2 -4
- package/dist/summary/summarizerNode/summarizerNodeUtils.js.map +1 -1
- package/dist/summary/summarizerNode/summarizerNodeWithGc.js +17 -16
- package/dist/summary/summarizerNode/summarizerNodeWithGc.js.map +1 -1
- package/dist/summary/summaryCollection.js +3 -5
- package/dist/summary/summaryCollection.js.map +1 -1
- package/dist/summary/summaryFormat.js +1 -2
- package/dist/summary/summaryFormat.js.map +1 -1
- package/dist/summary/summaryGenerator.js +62 -20
- package/dist/summary/summaryGenerator.js.map +1 -1
- package/dist/summary/summaryManager.js +3 -5
- package/dist/summary/summaryManager.js.map +1 -1
- package/lib/batchTracker.d.ts +2 -1
- package/lib/batchTracker.d.ts.map +1 -1
- package/lib/batchTracker.js.map +1 -1
- package/lib/blobManager.d.ts +4 -1
- package/lib/blobManager.d.ts.map +1 -1
- package/lib/blobManager.js +61 -26
- package/lib/blobManager.js.map +1 -1
- package/lib/connectionTelemetry.js +10 -2
- package/lib/connectionTelemetry.js.map +1 -1
- package/lib/containerRuntime.d.ts +26 -11
- package/lib/containerRuntime.d.ts.map +1 -1
- package/lib/containerRuntime.js +177 -123
- package/lib/containerRuntime.js.map +1 -1
- package/lib/dataStore.js +8 -2
- package/lib/dataStore.js.map +1 -1
- package/lib/dataStoreContext.js +23 -24
- package/lib/dataStoreContext.js.map +1 -1
- package/lib/dataStores.d.ts +20 -4
- package/lib/dataStores.d.ts.map +1 -1
- package/lib/dataStores.js +107 -53
- package/lib/dataStores.js.map +1 -1
- package/lib/gc/garbageCollection.js +17 -20
- package/lib/gc/garbageCollection.js.map +1 -1
- package/lib/gc/gcConfigs.js +13 -11
- package/lib/gc/gcConfigs.js.map +1 -1
- package/lib/gc/gcHelpers.js +4 -6
- package/lib/gc/gcHelpers.js.map +1 -1
- package/lib/gc/gcSummaryStateTracker.js +4 -6
- package/lib/gc/gcSummaryStateTracker.js.map +1 -1
- package/lib/gc/gcTelemetry.d.ts.map +1 -1
- package/lib/gc/gcTelemetry.js +55 -37
- package/lib/gc/gcTelemetry.js.map +1 -1
- package/lib/id-compressor/idCompressor.js +49 -51
- package/lib/id-compressor/idCompressor.js.map +1 -1
- package/lib/id-compressor/idRange.js +2 -2
- package/lib/id-compressor/idRange.js.map +1 -1
- package/lib/id-compressor/sessionIdNormalizer.js +11 -16
- package/lib/id-compressor/sessionIdNormalizer.js.map +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js.map +1 -1
- package/lib/opLifecycle/batchManager.js +10 -6
- package/lib/opLifecycle/batchManager.js.map +1 -1
- package/lib/opLifecycle/opCompressor.js +6 -1
- package/lib/opLifecycle/opCompressor.js.map +1 -1
- package/lib/opLifecycle/opDecompressor.js +11 -9
- package/lib/opLifecycle/opDecompressor.js.map +1 -1
- package/lib/opLifecycle/opGroupingManager.js +13 -5
- package/lib/opLifecycle/opGroupingManager.js.map +1 -1
- package/lib/opLifecycle/opSplitter.js +10 -6
- package/lib/opLifecycle/opSplitter.js.map +1 -1
- package/lib/opLifecycle/outbox.js +1 -2
- package/lib/opLifecycle/outbox.js.map +1 -1
- package/lib/opLifecycle/remoteMessageProcessor.js +1 -1
- package/lib/opLifecycle/remoteMessageProcessor.js.map +1 -1
- package/lib/opProperties.js +1 -2
- package/lib/opProperties.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/pendingStateManager.d.ts +2 -2
- package/lib/pendingStateManager.d.ts.map +1 -1
- package/lib/pendingStateManager.js +22 -22
- package/lib/pendingStateManager.js.map +1 -1
- package/lib/scheduleManager.js +14 -10
- package/lib/scheduleManager.js.map +1 -1
- package/lib/summary/orderedClientElection.d.ts +2 -1
- package/lib/summary/orderedClientElection.d.ts.map +1 -1
- package/lib/summary/orderedClientElection.js +17 -18
- package/lib/summary/orderedClientElection.js.map +1 -1
- package/lib/summary/runningSummarizer.js +32 -38
- package/lib/summary/runningSummarizer.js.map +1 -1
- package/lib/summary/summarizer.js +4 -7
- package/lib/summary/summarizer.js.map +1 -1
- package/lib/summary/summarizerClientElection.js +5 -9
- package/lib/summary/summarizerClientElection.js.map +1 -1
- package/lib/summary/summarizerHeuristics.js +8 -12
- package/lib/summary/summarizerHeuristics.js.map +1 -1
- package/lib/summary/summarizerNode/summarizerNode.js +22 -15
- package/lib/summary/summarizerNode/summarizerNode.js.map +1 -1
- package/lib/summary/summarizerNode/summarizerNodeUtils.js +2 -4
- package/lib/summary/summarizerNode/summarizerNodeUtils.js.map +1 -1
- package/lib/summary/summarizerNode/summarizerNodeWithGc.js +17 -16
- package/lib/summary/summarizerNode/summarizerNodeWithGc.js.map +1 -1
- package/lib/summary/summaryCollection.js +3 -5
- package/lib/summary/summaryCollection.js.map +1 -1
- package/lib/summary/summaryFormat.js +1 -2
- package/lib/summary/summaryFormat.js.map +1 -1
- package/lib/summary/summaryGenerator.js +62 -20
- package/lib/summary/summaryGenerator.js.map +1 -1
- package/lib/summary/summaryManager.js +3 -5
- package/lib/summary/summaryManager.js.map +1 -1
- package/package.json +17 -17
- package/src/batchTracker.ts +2 -1
- package/src/blobManager.ts +43 -2
- package/src/containerRuntime.ts +74 -51
- package/src/dataStore.ts +7 -1
- package/src/dataStores.ts +95 -55
- package/src/gc/gcTelemetry.ts +1 -2
- package/src/index.ts +0 -1
- package/src/packageVersion.ts +1 -1
- package/src/pendingStateManager.ts +12 -15
- package/src/summary/orderedClientElection.ts +2 -1
package/src/dataStores.ts
CHANGED
|
@@ -431,8 +431,7 @@ export class DataStores implements IDisposable {
|
|
|
431
431
|
) {
|
|
432
432
|
const envelope = message.contents as IEnvelope;
|
|
433
433
|
const transformed = { ...message, contents: envelope.contents };
|
|
434
|
-
|
|
435
|
-
this.validateNotDeleted(envelope.address, request);
|
|
434
|
+
this.validateNotDeleted(envelope.address);
|
|
436
435
|
const context = this.contexts.get(envelope.address);
|
|
437
436
|
assert(!!context, 0x162 /* "There should be a store context for the op" */);
|
|
438
437
|
context.process(transformed, local, localMessageMetadata);
|
|
@@ -451,104 +450,145 @@ export class DataStores implements IDisposable {
|
|
|
451
450
|
requestHeaderData: RuntimeHeaderData,
|
|
452
451
|
): Promise<FluidDataStoreContext> {
|
|
453
452
|
const headerData = { ...defaultRuntimeHeaderData, ...requestHeaderData };
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
this.validateNotDeleted(id, request, headerData);
|
|
453
|
+
this.validateNotDeleted(id, headerData);
|
|
457
454
|
|
|
458
455
|
const context = await this.contexts.getBoundOrRemoted(id, headerData.wait);
|
|
459
456
|
if (context === undefined) {
|
|
460
457
|
// The requested data store does not exits. Throw a 404 response exception.
|
|
458
|
+
const request: IRequest = { url: id };
|
|
461
459
|
throw responseToException(create404Response(request), request);
|
|
462
460
|
}
|
|
463
461
|
|
|
464
|
-
this.validateNotTombstoned(context,
|
|
462
|
+
this.validateNotTombstoned(context, requestHeaderData);
|
|
465
463
|
|
|
466
464
|
return context;
|
|
467
465
|
}
|
|
468
466
|
|
|
469
467
|
/**
|
|
470
|
-
*
|
|
471
|
-
|
|
468
|
+
* Returns the data store requested with the given id if available. Otherwise, returns undefined.
|
|
469
|
+
*/
|
|
470
|
+
public async getDataStoreIfAvailable(
|
|
471
|
+
id: string,
|
|
472
|
+
requestHeaderData: RuntimeHeaderData,
|
|
473
|
+
): Promise<FluidDataStoreContext | undefined> {
|
|
474
|
+
// If the data store has been deleted, return undefined.
|
|
475
|
+
if (this.checkIfDeleted(id, requestHeaderData)) {
|
|
476
|
+
return undefined;
|
|
477
|
+
}
|
|
478
|
+
const headerData = { ...defaultRuntimeHeaderData, ...requestHeaderData };
|
|
479
|
+
const context = await this.contexts.getBoundOrRemoted(id, headerData.wait);
|
|
480
|
+
if (context === undefined) {
|
|
481
|
+
return undefined;
|
|
482
|
+
}
|
|
483
|
+
// Check if the data store is tombstoned. If so, we want to log a telemetry event.
|
|
484
|
+
this.checkIfTombstoned(context, requestHeaderData);
|
|
485
|
+
return context;
|
|
486
|
+
}
|
|
487
|
+
|
|
488
|
+
/**
|
|
489
|
+
* Checks if the data store has been deleted by GC.
|
|
472
490
|
* @param id - data store id
|
|
473
491
|
* @param request - the request information to log if the validation detects the data store has been deleted
|
|
474
492
|
* @param requestHeaderData - the request header information to log if the validation detects the data store has been deleted
|
|
493
|
+
* @returns true if the data store is deleted. Otherwise, returns false.
|
|
475
494
|
*/
|
|
476
|
-
private
|
|
477
|
-
id: string,
|
|
478
|
-
request: IRequest,
|
|
479
|
-
requestHeaderData?: RuntimeHeaderData,
|
|
480
|
-
) {
|
|
495
|
+
private checkIfDeleted(id: string, requestHeaderData?: RuntimeHeaderData) {
|
|
481
496
|
const dataStoreNodePath = `/${id}`;
|
|
482
|
-
if (this.isDataStoreDeleted(dataStoreNodePath)) {
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
)
|
|
497
|
+
if (!this.isDataStoreDeleted(dataStoreNodePath)) {
|
|
498
|
+
return false;
|
|
499
|
+
}
|
|
500
|
+
assert(
|
|
501
|
+
!this.contexts.has(id),
|
|
502
|
+
0x570 /* Inconsistent state! GC says the data store is deleted, but the data store is not deleted from the runtime. */,
|
|
503
|
+
);
|
|
504
|
+
sendGCUnexpectedUsageEvent(
|
|
505
|
+
this.mc,
|
|
506
|
+
{
|
|
507
|
+
eventName: "GC_Deleted_DataStore_Requested",
|
|
508
|
+
category: "error",
|
|
509
|
+
isSummarizerClient: this.runtime.clientDetails.type === summarizerClientType,
|
|
510
|
+
id,
|
|
511
|
+
headers: JSON.stringify(requestHeaderData),
|
|
512
|
+
gcTombstoneEnforcementAllowed: this.runtime.gcTombstoneEnforcementAllowed,
|
|
513
|
+
},
|
|
514
|
+
undefined /* packagePath */,
|
|
515
|
+
);
|
|
516
|
+
return true;
|
|
517
|
+
}
|
|
518
|
+
|
|
519
|
+
/**
|
|
520
|
+
* Validate that the data store had not been deleted by GC.
|
|
521
|
+
* @param id - data store id
|
|
522
|
+
* @param requestHeaderData - the request header information to log if the validation detects the data store has been deleted
|
|
523
|
+
*/
|
|
524
|
+
private validateNotDeleted(id: string, requestHeaderData?: RuntimeHeaderData) {
|
|
525
|
+
if (this.checkIfDeleted(id, requestHeaderData)) {
|
|
487
526
|
// The requested data store is removed by gc. Create a 404 gc response exception.
|
|
488
|
-
const
|
|
527
|
+
const request: IRequest = { url: id };
|
|
528
|
+
throw responseToException(
|
|
489
529
|
createResponseError(404, "DataStore was deleted", request),
|
|
490
530
|
request,
|
|
491
531
|
);
|
|
492
|
-
sendGCUnexpectedUsageEvent(
|
|
493
|
-
this.mc,
|
|
494
|
-
{
|
|
495
|
-
eventName: "GC_Deleted_DataStore_Requested",
|
|
496
|
-
category: "error",
|
|
497
|
-
isSummarizerClient: this.runtime.clientDetails.type === summarizerClientType,
|
|
498
|
-
headers: JSON.stringify(requestHeaderData),
|
|
499
|
-
gcTombstoneEnforcementAllowed: this.runtime.gcTombstoneEnforcementAllowed,
|
|
500
|
-
},
|
|
501
|
-
undefined /** packagePath */,
|
|
502
|
-
error,
|
|
503
|
-
);
|
|
504
|
-
throw error;
|
|
505
532
|
}
|
|
506
533
|
}
|
|
507
534
|
|
|
535
|
+
/**
|
|
536
|
+
* Checks if the data store has not been marked as tombstone by GC or not.
|
|
537
|
+
* @param context - the data store context in question
|
|
538
|
+
* @param requestHeaderData - the request header information to log if the validation detects the data store has been tombstoned
|
|
539
|
+
* @returns true if the data store is tombstoned. Otherwise, returns false.
|
|
540
|
+
*/
|
|
541
|
+
private checkIfTombstoned(
|
|
542
|
+
context: FluidDataStoreContext,
|
|
543
|
+
requestHeaderData: RuntimeHeaderData,
|
|
544
|
+
) {
|
|
545
|
+
if (!context.tombstoned) {
|
|
546
|
+
return false;
|
|
547
|
+
}
|
|
548
|
+
const logErrorEvent = this.throwOnTombstoneLoad && !requestHeaderData.allowTombstone;
|
|
549
|
+
sendGCUnexpectedUsageEvent(
|
|
550
|
+
this.mc,
|
|
551
|
+
{
|
|
552
|
+
eventName: "GC_Tombstone_DataStore_Requested",
|
|
553
|
+
category: logErrorEvent ? "error" : "generic",
|
|
554
|
+
isSummarizerClient: this.runtime.clientDetails.type === summarizerClientType,
|
|
555
|
+
id: context.id,
|
|
556
|
+
headers: JSON.stringify(requestHeaderData),
|
|
557
|
+
gcTombstoneEnforcementAllowed: this.runtime.gcTombstoneEnforcementAllowed,
|
|
558
|
+
},
|
|
559
|
+
context.isLoaded ? context.packagePath : undefined,
|
|
560
|
+
);
|
|
561
|
+
return true;
|
|
562
|
+
}
|
|
563
|
+
|
|
508
564
|
/**
|
|
509
565
|
* Validates that the data store context requested has not been marked as tombstone by GC.
|
|
510
|
-
*
|
|
511
566
|
* @param context - the data store context in question
|
|
512
567
|
* @param request - the request information to log if the validation detects the data store has been tombstoned
|
|
513
|
-
* @param
|
|
568
|
+
* @param requestHeaderData - the request header information to log if the validation detects the data store has been tombstoned
|
|
514
569
|
*/
|
|
515
570
|
private validateNotTombstoned(
|
|
516
571
|
context: FluidDataStoreContext,
|
|
517
|
-
|
|
518
|
-
headerData: RuntimeHeaderData,
|
|
572
|
+
requestHeaderData: RuntimeHeaderData,
|
|
519
573
|
) {
|
|
520
|
-
if (context
|
|
521
|
-
const shouldFail = this.throwOnTombstoneLoad && !headerData.allowTombstone;
|
|
522
|
-
|
|
574
|
+
if (this.checkIfTombstoned(context, requestHeaderData)) {
|
|
523
575
|
// The requested data store is removed by gc. Create a 404 gc response exception.
|
|
576
|
+
const request: IRequest = { url: context.id };
|
|
524
577
|
const error = responseToException(
|
|
525
578
|
createResponseError(404, "DataStore was deleted", request, {
|
|
526
579
|
[TombstoneResponseHeaderKey]: true,
|
|
527
580
|
}),
|
|
528
581
|
request,
|
|
529
582
|
);
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
{
|
|
533
|
-
eventName: "GC_Tombstone_DataStore_Requested",
|
|
534
|
-
category: shouldFail ? "error" : "generic",
|
|
535
|
-
isSummarizerClient: this.runtime.clientDetails.type === summarizerClientType,
|
|
536
|
-
headers: JSON.stringify(headerData),
|
|
537
|
-
gcTombstoneEnforcementAllowed: this.runtime.gcTombstoneEnforcementAllowed,
|
|
538
|
-
},
|
|
539
|
-
context.isLoaded ? context.packagePath : undefined,
|
|
540
|
-
error,
|
|
541
|
-
);
|
|
542
|
-
|
|
543
|
-
if (shouldFail) {
|
|
583
|
+
// Throw an error if configured via options and via request headers.
|
|
584
|
+
if (this.throwOnTombstoneLoad && !requestHeaderData.allowTombstone) {
|
|
544
585
|
throw error;
|
|
545
586
|
}
|
|
546
587
|
}
|
|
547
588
|
}
|
|
548
589
|
|
|
549
590
|
public processSignal(fluidDataStoreId: string, message: IInboundSignalMessage, local: boolean) {
|
|
550
|
-
|
|
551
|
-
this.validateNotDeleted(fluidDataStoreId, request);
|
|
591
|
+
this.validateNotDeleted(fluidDataStoreId);
|
|
552
592
|
const context = this.contexts.get(fluidDataStoreId);
|
|
553
593
|
if (!context) {
|
|
554
594
|
// Attach message may not have been processed yet
|
package/src/gc/gcTelemetry.ts
CHANGED
|
@@ -5,7 +5,6 @@
|
|
|
5
5
|
|
|
6
6
|
import { ITelemetryGenericEvent } from "@fluidframework/core-interfaces";
|
|
7
7
|
import { IGarbageCollectionData } from "@fluidframework/runtime-definitions";
|
|
8
|
-
import { packagePathToTelemetryProperty } from "@fluidframework/runtime-utils";
|
|
9
8
|
import {
|
|
10
9
|
generateStack,
|
|
11
10
|
ITelemetryLoggerExt,
|
|
@@ -211,7 +210,7 @@ export class GCTelemetryTracker {
|
|
|
211
210
|
const { id: taggedId, fromId: taggedFromId, ...otherProps } = eventProps;
|
|
212
211
|
const event = {
|
|
213
212
|
eventName: `${state}Object_${nodeUsageProps.usageType}`,
|
|
214
|
-
pkg:
|
|
213
|
+
pkg: tagCodeArtifacts({ pkg: nodeUsageProps.packagePath?.join("/") }).pkg,
|
|
215
214
|
stack: generateStack(),
|
|
216
215
|
id: taggedId,
|
|
217
216
|
fromId: taggedFromId,
|
package/src/index.ts
CHANGED
package/src/packageVersion.ts
CHANGED
|
@@ -16,7 +16,7 @@ import { pkgVersion } from "./packageVersion";
|
|
|
16
16
|
import { IBatchMetadata } from "./metadata";
|
|
17
17
|
|
|
18
18
|
/**
|
|
19
|
-
* ! TODO: Remove this interface in "2.0.0-internal.7.0.0" once we only read IPendingMessageNew
|
|
19
|
+
* ! TODO: Remove this interface in "2.0.0-internal.7.0.0" once we only read IPendingMessageNew (AB#4763)
|
|
20
20
|
*/
|
|
21
21
|
export interface IPendingMessageOld {
|
|
22
22
|
type: "message";
|
|
@@ -42,7 +42,7 @@ export interface IPendingMessageNew {
|
|
|
42
42
|
}
|
|
43
43
|
|
|
44
44
|
/**
|
|
45
|
-
* ! TODO: Remove this type in "2.0.0-internal.7.0.0"
|
|
45
|
+
* ! TODO: Remove this type in "2.0.0-internal.7.0.0" (AB#4763)
|
|
46
46
|
*/
|
|
47
47
|
export type IPendingState = IPendingMessageOld | IPendingMessageNew;
|
|
48
48
|
|
|
@@ -115,21 +115,18 @@ export class PendingStateManager implements IDisposable {
|
|
|
115
115
|
if (!this.pendingMessages.isEmpty()) {
|
|
116
116
|
return {
|
|
117
117
|
pendingStates: this.pendingMessages.toArray().map((message) => {
|
|
118
|
-
|
|
119
|
-
const
|
|
118
|
+
let content = message.content;
|
|
119
|
+
const parsedContent = JSON.parse(content);
|
|
120
120
|
// IdAllocations need their localOpMetadata stashed in the contents
|
|
121
121
|
// of the op to correctly resume the session when processing stashed ops
|
|
122
|
-
if (
|
|
123
|
-
|
|
122
|
+
if (parsedContent.type === ContainerMessageType.IdAllocation) {
|
|
123
|
+
parsedContent.contents.stashedState = message.localOpMetadata;
|
|
124
|
+
content = JSON.stringify(parsedContent);
|
|
124
125
|
}
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
// delete localOpMetadata since it may not be serializable
|
|
130
|
-
// and will be regenerated by applyStashedOp()
|
|
131
|
-
localOpMetadata: undefined,
|
|
132
|
-
};
|
|
126
|
+
|
|
127
|
+
// delete localOpMetadata since it may not be serializable
|
|
128
|
+
// and will be regenerated by applyStashedOp()
|
|
129
|
+
return { ...message, content, localOpMetadata: undefined };
|
|
133
130
|
}),
|
|
134
131
|
};
|
|
135
132
|
}
|
|
@@ -142,7 +139,7 @@ export class PendingStateManager implements IDisposable {
|
|
|
142
139
|
) {
|
|
143
140
|
/**
|
|
144
141
|
* Convert old local state format to the new format (IPendingMessageOld to IPendingMessageNew)
|
|
145
|
-
* ! TODO: Remove this conversion in "2.0.0-internal.7.0.0"
|
|
142
|
+
* ! TODO: Remove this conversion in "2.0.0-internal.7.0.0" (AB#4763)
|
|
146
143
|
*/
|
|
147
144
|
if (initialLocalState?.pendingStates) {
|
|
148
145
|
for (const initialState of initialLocalState.pendingStates) {
|
|
@@ -9,6 +9,7 @@ import { assert, TypedEventEmitter } from "@fluidframework/common-utils";
|
|
|
9
9
|
import { IDeltaManager } from "@fluidframework/container-definitions";
|
|
10
10
|
import { UsageError } from "@fluidframework/container-utils";
|
|
11
11
|
import { IClient, IQuorumClients, ISequencedClient } from "@fluidframework/protocol-definitions";
|
|
12
|
+
import { ITelemetryBaseLogger } from "@fluidframework/core-interfaces";
|
|
12
13
|
import { summarizerClientType } from "./summarizerClientElection";
|
|
13
14
|
|
|
14
15
|
// helper types for recursive readonly.
|
|
@@ -101,7 +102,7 @@ export class OrderedClientCollection
|
|
|
101
102
|
}
|
|
102
103
|
|
|
103
104
|
constructor(
|
|
104
|
-
logger:
|
|
105
|
+
logger: ITelemetryBaseLogger,
|
|
105
106
|
deltaManager: Pick<IDeltaManager<unknown, unknown>, "lastSequenceNumber">,
|
|
106
107
|
quorum: Pick<IQuorumClients, "getMembers" | "on">,
|
|
107
108
|
) {
|