@fluidframework/map 2.70.0-361248 → 2.70.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/CHANGELOG.md +4 -0
- package/dist/directory.d.ts +16 -15
- package/dist/directory.d.ts.map +1 -1
- package/dist/directory.js +47 -40
- package/dist/directory.js.map +1 -1
- package/dist/map.d.ts +4 -4
- package/dist/map.d.ts.map +1 -1
- package/dist/map.js +10 -4
- package/dist/map.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/lib/directory.d.ts +16 -15
- package/lib/directory.d.ts.map +1 -1
- package/lib/directory.js +48 -41
- package/lib/directory.js.map +1 -1
- package/lib/map.d.ts +4 -4
- package/lib/map.d.ts.map +1 -1
- package/lib/map.js +11 -5
- package/lib/map.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/package.json +16 -16
- package/src/directory.ts +97 -49
- package/src/map.ts +18 -11
- package/src/packageVersion.ts +1 -1
package/CHANGELOG.md
CHANGED
package/dist/directory.d.ts
CHANGED
|
@@ -4,8 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import { TypedEventEmitter } from "@fluid-internal/client-utils";
|
|
6
6
|
import type { IChannelAttributes, IFluidDataStoreRuntime, IChannelStorageService } from "@fluidframework/datastore-definitions/internal";
|
|
7
|
-
import {
|
|
8
|
-
import type { ISummaryTreeWithStats, ITelemetryContext } from "@fluidframework/runtime-definitions/internal";
|
|
7
|
+
import type { ISummaryTreeWithStats, ITelemetryContext, IRuntimeMessageCollection, ISequencedMessageEnvelope } from "@fluidframework/runtime-definitions/internal";
|
|
9
8
|
import type { IFluidSerializer } from "@fluidframework/shared-object-base/internal";
|
|
10
9
|
import { SharedObject } from "@fluidframework/shared-object-base/internal";
|
|
11
10
|
import { type ITelemetryLoggerExt } from "@fluidframework/telemetry-utils/internal";
|
|
@@ -355,9 +354,10 @@ export declare class SharedDirectory extends SharedObject<ISharedDirectoryEvents
|
|
|
355
354
|
*/
|
|
356
355
|
protected populate(data: IDirectoryDataObject): void;
|
|
357
356
|
/**
|
|
358
|
-
* {@inheritDoc @fluidframework/shared-object-base#SharedObject.
|
|
357
|
+
* {@inheritDoc @fluidframework/shared-object-base#SharedObject.processMessagesCore}
|
|
359
358
|
*/
|
|
360
|
-
protected
|
|
359
|
+
protected processMessagesCore(messagesCollection: IRuntimeMessageCollection): void;
|
|
360
|
+
private processMessage;
|
|
361
361
|
/**
|
|
362
362
|
* {@inheritDoc @fluidframework/shared-object-base#SharedObject.rollback}
|
|
363
363
|
*/
|
|
@@ -582,49 +582,50 @@ declare class SubDirectory extends TypedEventEmitter<IDirectoryEvents> implement
|
|
|
582
582
|
get sequencedSubdirectories(): ReadonlyMap<string, SubDirectory>;
|
|
583
583
|
/**
|
|
584
584
|
* Process a clear operation.
|
|
585
|
-
* @param
|
|
585
|
+
* @param msgEnvelope - The envelope of the message from the server to apply.
|
|
586
586
|
* @param op - The op to process
|
|
587
587
|
* @param local - Whether the message originated from the local client
|
|
588
588
|
* @param localOpMetadata - For local client messages, this is the metadata that was submitted with the message.
|
|
589
589
|
* For messages from a remote client, this will be undefined.
|
|
590
590
|
*/
|
|
591
|
-
processClearMessage(
|
|
591
|
+
processClearMessage(msgEnvelope: ISequencedMessageEnvelope, op: IDirectoryClearOperation, local: boolean, localOpMetadata: ClearLocalOpMetadata | undefined): void;
|
|
592
592
|
/**
|
|
593
593
|
* Process a delete operation.
|
|
594
|
-
* @param
|
|
594
|
+
* @param msgEnvelope - The envelope of the message from the server to apply.
|
|
595
595
|
* @param op - The op to process
|
|
596
596
|
* @param local - Whether the message originated from the local client
|
|
597
597
|
* @param localOpMetadata - For local client messages, this is the metadata that was submitted with the message.
|
|
598
598
|
* For messages from a remote client, this will be undefined.
|
|
599
599
|
*/
|
|
600
|
-
processDeleteMessage(
|
|
600
|
+
processDeleteMessage(msgEnvelope: ISequencedMessageEnvelope, op: IDirectoryDeleteOperation, local: boolean, localOpMetadata: EditLocalOpMetadata | undefined): void;
|
|
601
601
|
/**
|
|
602
602
|
* Process a set operation.
|
|
603
|
-
* @param
|
|
603
|
+
* @param msgEnvelope - The envelope of the message from the server to apply.
|
|
604
604
|
* @param op - The op to process
|
|
605
605
|
* @param local - Whether the message originated from the local client
|
|
606
606
|
* @param localOpMetadata - For local client messages, this is the metadata that was submitted with the message.
|
|
607
607
|
* For messages from a remote client, this will be undefined.
|
|
608
608
|
*/
|
|
609
|
-
processSetMessage(
|
|
609
|
+
processSetMessage(msgEnvelope: ISequencedMessageEnvelope, op: IDirectorySetOperation, value: unknown, local: boolean, localOpMetadata: EditLocalOpMetadata | undefined): void;
|
|
610
610
|
/**
|
|
611
611
|
* Process a create subdirectory operation.
|
|
612
|
-
* @param
|
|
612
|
+
* @param msgEnvelope - The envelope of the message from the server to apply.
|
|
613
613
|
* @param op - The op to process
|
|
614
614
|
* @param local - Whether the message originated from the local client
|
|
615
615
|
* @param localOpMetadata - For local client messages, this is the metadata that was submitted with the message.
|
|
616
616
|
* For messages from a remote client, this will be undefined.
|
|
617
|
+
* @param clientSequenceNumber - The client sequence number of the message.
|
|
617
618
|
*/
|
|
618
|
-
processCreateSubDirectoryMessage(
|
|
619
|
+
processCreateSubDirectoryMessage(msgEnvelope: ISequencedMessageEnvelope, op: IDirectoryCreateSubDirectoryOperation, local: boolean, localOpMetadata: SubDirLocalOpMetadata | undefined, clientSequenceNumber: number): void;
|
|
619
620
|
/**
|
|
620
621
|
* Process a delete subdirectory operation.
|
|
621
|
-
* @param
|
|
622
|
+
* @param msgEnvelope - The envelope of the message from the server to apply.
|
|
622
623
|
* @param op - The op to process
|
|
623
624
|
* @param local - Whether the message originated from the local client
|
|
624
625
|
* @param localOpMetadata - For local client messages, this is the metadata that was submitted with the message.
|
|
625
626
|
* For messages from a remote client, this will be undefined.
|
|
626
627
|
*/
|
|
627
|
-
processDeleteSubDirectoryMessage(
|
|
628
|
+
processDeleteSubDirectoryMessage(msgEnvelope: ISequencedMessageEnvelope, op: IDirectoryDeleteSubDirectoryOperation, local: boolean, localOpMetadata: SubDirLocalOpMetadata | undefined): void;
|
|
628
629
|
/**
|
|
629
630
|
* Submit a clear operation.
|
|
630
631
|
* @param op - The operation
|
|
@@ -699,7 +700,7 @@ declare class SubDirectory extends TypedEventEmitter<IDirectoryEvents> implement
|
|
|
699
700
|
/**
|
|
700
701
|
* This return true if the message is for the current instance of this sub directory. As the sub directory
|
|
701
702
|
* can be deleted and created again, then this finds if the message is for current instance of directory or not.
|
|
702
|
-
* @param
|
|
703
|
+
* @param msgEnvelope - message envelope for the directory
|
|
703
704
|
* @param targetSubdir - subdirectory instance we are targeting from local op metadata (if a local op)
|
|
704
705
|
*/
|
|
705
706
|
private isMessageForCurrentInstanceOfSubDirectory;
|
package/dist/directory.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"directory.d.ts","sourceRoot":"","sources":["../src/directory.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AAEjE,OAAO,KAAK,EACX,kBAAkB,EAClB,sBAAsB,EACtB,sBAAsB,EACtB,MAAM,gDAAgD,CAAC;
|
|
1
|
+
{"version":3,"file":"directory.d.ts","sourceRoot":"","sources":["../src/directory.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AAEjE,OAAO,KAAK,EACX,kBAAkB,EAClB,sBAAsB,EACtB,sBAAsB,EACtB,MAAM,gDAAgD,CAAC;AAGxD,OAAO,KAAK,EACX,qBAAqB,EACrB,iBAAiB,EACjB,yBAAyB,EAEzB,yBAAyB,EACzB,MAAM,8CAA8C,CAAC;A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,EAAE,EAAE,sBAAsB,EAC1B,eAAe,EAAE,mBAAmB,GAClC,IAAI;IAiBP;;;OAGG;IACH,OAAO,CAAC,+BAA+B;IAQvC;;;;OAIG;IACH,OAAO,CAAC,+BAA+B;IAYvC;;;;OAIG;IACI,2BAA2B,CACjC,EAAE,EAAE,+BAA+B,EACnC,eAAe,EAAE,qBAAqB,GACpC,IAAI;IAoCP;;;;OAIG;IACK,oBAAoB,CAC3B,UAAU,EAAE,gBAAgB,GAC1B,SAAS,CAAC,CAAC,MAAM,EAAE,gBAAgB,CAAC,EAAE,IAAI,CAAC;IASvC,yBAAyB,IAAI,WAAW;IAS/C;;;;OAIG;IACI,eAAe,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,IAAI;IAKzD;;;;OAIG;IACI,oBAAoB,CAAC,UAAU,EAAE,MAAM,EAAE,SAAS,EAAE,YAAY,GAAG,IAAI;IAM9E;;;;OAIG;IAEI,QAAQ,CAAC,EAAE,EAAE,GAAG,EAAE,eAAe,EAAE,wBAAwB,GAAG,IAAI;IAwJzE;;;;OAIG;IACH,OAAO,CAAC,YAAY;IAIpB;;;;;OAKG;IACH,OAAO,CAAC,yCAAyC;IAgBjD,OAAO,CAAC,4BAA4B;IASpC,OAAO,CAAC,uBAAuB;IAiB/B,OAAO,CAAC,wBAAwB;IAehC,OAAO,CAAC,yBAAyB;IAQjC;;OAEG;IACH,OAAO,CAAC,+BAA+B;IAwCvC;;;;OAIG;IACI,8BAA8B,IAAI,IAAI;CAQ7C"}
|
package/dist/directory.js
CHANGED
|
@@ -391,15 +391,21 @@ class SharedDirectory extends internal_5.SharedObject {
|
|
|
391
391
|
}
|
|
392
392
|
}
|
|
393
393
|
/**
|
|
394
|
-
* {@inheritDoc @fluidframework/shared-object-base#SharedObject.
|
|
394
|
+
* {@inheritDoc @fluidframework/shared-object-base#SharedObject.processMessagesCore}
|
|
395
395
|
*/
|
|
396
|
-
|
|
396
|
+
processMessagesCore(messagesCollection) {
|
|
397
|
+
const { envelope, local, messagesContent } = messagesCollection;
|
|
398
|
+
for (const messageContent of messagesContent) {
|
|
399
|
+
this.processMessage(envelope, messageContent, local);
|
|
400
|
+
}
|
|
401
|
+
}
|
|
402
|
+
processMessage(messageEnvelope, messageContent, local) {
|
|
397
403
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-enum-comparison
|
|
398
|
-
if (
|
|
399
|
-
const op =
|
|
404
|
+
if (messageEnvelope.type === internal_2.MessageType.Operation) {
|
|
405
|
+
const op = messageContent.contents;
|
|
400
406
|
const handler = this.messageHandlers.get(op.type);
|
|
401
407
|
(0, internal_1.assert)(handler !== undefined, 0x00e /* "Missing message handler for message type: op may be from a newer version */);
|
|
402
|
-
handler.process(
|
|
408
|
+
handler.process(messageEnvelope, op, local, messageContent.localOpMetadata, messageContent.clientSequenceNumber);
|
|
403
409
|
}
|
|
404
410
|
}
|
|
405
411
|
/**
|
|
@@ -430,10 +436,10 @@ class SharedDirectory extends internal_5.SharedObject {
|
|
|
430
436
|
// `resubmit`: When resubmitting ops, we use `localOpMetadata` to get a reference to the subdirectory that
|
|
431
437
|
// the op was originally targeting.
|
|
432
438
|
this.messageHandlers.set("clear", {
|
|
433
|
-
process: (
|
|
439
|
+
process: (msgEnvelope, op, local, localOpMetadata, clientSequenceNumber) => {
|
|
434
440
|
const subdir = this.getSequencedWorkingDirectory(op.path);
|
|
435
441
|
if (subdir !== undefined && !subdir?.disposed) {
|
|
436
|
-
subdir.processClearMessage(
|
|
442
|
+
subdir.processClearMessage(msgEnvelope, op, local, localOpMetadata);
|
|
437
443
|
}
|
|
438
444
|
},
|
|
439
445
|
resubmit: (op, localOpMetadata) => {
|
|
@@ -444,10 +450,10 @@ class SharedDirectory extends internal_5.SharedObject {
|
|
|
444
450
|
},
|
|
445
451
|
});
|
|
446
452
|
this.messageHandlers.set("delete", {
|
|
447
|
-
process: (
|
|
453
|
+
process: (msgEnvelope, op, local, localOpMetadata, clientSequenceNumber) => {
|
|
448
454
|
const subdir = this.getSequencedWorkingDirectory(op.path);
|
|
449
455
|
if (subdir !== undefined && !subdir?.disposed) {
|
|
450
|
-
subdir.processDeleteMessage(
|
|
456
|
+
subdir.processDeleteMessage(msgEnvelope, op, local, localOpMetadata);
|
|
451
457
|
}
|
|
452
458
|
},
|
|
453
459
|
resubmit: (op, localOpMetadata) => {
|
|
@@ -458,12 +464,12 @@ class SharedDirectory extends internal_5.SharedObject {
|
|
|
458
464
|
},
|
|
459
465
|
});
|
|
460
466
|
this.messageHandlers.set("set", {
|
|
461
|
-
process: (
|
|
467
|
+
process: (msgEnvelope, op, local, localOpMetadata, clientSequenceNumber) => {
|
|
462
468
|
const subdir = this.getSequencedWorkingDirectory(op.path);
|
|
463
469
|
if (subdir !== undefined && !subdir?.disposed) {
|
|
464
470
|
(0, localValues_js_1.migrateIfSharedSerializable)(op.value, this.serializer, this.handle);
|
|
465
471
|
const localValue = local ? undefined : op.value.value;
|
|
466
|
-
subdir.processSetMessage(
|
|
472
|
+
subdir.processSetMessage(msgEnvelope, op, localValue, local, localOpMetadata);
|
|
467
473
|
}
|
|
468
474
|
},
|
|
469
475
|
resubmit: (op, localOpMetadata) => {
|
|
@@ -474,10 +480,10 @@ class SharedDirectory extends internal_5.SharedObject {
|
|
|
474
480
|
},
|
|
475
481
|
});
|
|
476
482
|
this.messageHandlers.set("createSubDirectory", {
|
|
477
|
-
process: (
|
|
483
|
+
process: (msgEnvelope, op, local, localOpMetadata, clientSequenceNumber) => {
|
|
478
484
|
const parentSubdir = this.getSequencedWorkingDirectory(op.path);
|
|
479
485
|
if (parentSubdir !== undefined && !parentSubdir?.disposed) {
|
|
480
|
-
parentSubdir.processCreateSubDirectoryMessage(
|
|
486
|
+
parentSubdir.processCreateSubDirectoryMessage(msgEnvelope, op, local, localOpMetadata, clientSequenceNumber);
|
|
481
487
|
}
|
|
482
488
|
},
|
|
483
489
|
resubmit: (op, localOpMetadata) => {
|
|
@@ -489,10 +495,10 @@ class SharedDirectory extends internal_5.SharedObject {
|
|
|
489
495
|
},
|
|
490
496
|
});
|
|
491
497
|
this.messageHandlers.set("deleteSubDirectory", {
|
|
492
|
-
process: (
|
|
498
|
+
process: (msgEnvelope, op, local, localOpMetadata) => {
|
|
493
499
|
const parentSubdir = this.getSequencedWorkingDirectory(op.path);
|
|
494
500
|
if (parentSubdir !== undefined && !parentSubdir?.disposed) {
|
|
495
|
-
parentSubdir.processDeleteSubDirectoryMessage(
|
|
501
|
+
parentSubdir.processDeleteSubDirectoryMessage(msgEnvelope, op, local, localOpMetadata);
|
|
496
502
|
}
|
|
497
503
|
},
|
|
498
504
|
resubmit: (op, localOpMetadata) => {
|
|
@@ -1249,15 +1255,15 @@ class SubDirectory extends client_utils_1.TypedEventEmitter {
|
|
|
1249
1255
|
}
|
|
1250
1256
|
/**
|
|
1251
1257
|
* Process a clear operation.
|
|
1252
|
-
* @param
|
|
1258
|
+
* @param msgEnvelope - The envelope of the message from the server to apply.
|
|
1253
1259
|
* @param op - The op to process
|
|
1254
1260
|
* @param local - Whether the message originated from the local client
|
|
1255
1261
|
* @param localOpMetadata - For local client messages, this is the metadata that was submitted with the message.
|
|
1256
1262
|
* For messages from a remote client, this will be undefined.
|
|
1257
1263
|
*/
|
|
1258
|
-
processClearMessage(
|
|
1264
|
+
processClearMessage(msgEnvelope, op, local, localOpMetadata) {
|
|
1259
1265
|
this.throwIfDisposed();
|
|
1260
|
-
if (!this.isMessageForCurrentInstanceOfSubDirectory(
|
|
1266
|
+
if (!this.isMessageForCurrentInstanceOfSubDirectory(msgEnvelope, localOpMetadata?.subdir)) {
|
|
1261
1267
|
return;
|
|
1262
1268
|
}
|
|
1263
1269
|
if (local) {
|
|
@@ -1293,15 +1299,15 @@ class SubDirectory extends client_utils_1.TypedEventEmitter {
|
|
|
1293
1299
|
}
|
|
1294
1300
|
/**
|
|
1295
1301
|
* Process a delete operation.
|
|
1296
|
-
* @param
|
|
1302
|
+
* @param msgEnvelope - The envelope of the message from the server to apply.
|
|
1297
1303
|
* @param op - The op to process
|
|
1298
1304
|
* @param local - Whether the message originated from the local client
|
|
1299
1305
|
* @param localOpMetadata - For local client messages, this is the metadata that was submitted with the message.
|
|
1300
1306
|
* For messages from a remote client, this will be undefined.
|
|
1301
1307
|
*/
|
|
1302
|
-
processDeleteMessage(
|
|
1308
|
+
processDeleteMessage(msgEnvelope, op, local, localOpMetadata) {
|
|
1303
1309
|
this.throwIfDisposed();
|
|
1304
|
-
if (!this.isMessageForCurrentInstanceOfSubDirectory(
|
|
1310
|
+
if (!this.isMessageForCurrentInstanceOfSubDirectory(msgEnvelope, localOpMetadata?.subdir)) {
|
|
1305
1311
|
return;
|
|
1306
1312
|
}
|
|
1307
1313
|
if (local) {
|
|
@@ -1331,15 +1337,15 @@ class SubDirectory extends client_utils_1.TypedEventEmitter {
|
|
|
1331
1337
|
}
|
|
1332
1338
|
/**
|
|
1333
1339
|
* Process a set operation.
|
|
1334
|
-
* @param
|
|
1340
|
+
* @param msgEnvelope - The envelope of the message from the server to apply.
|
|
1335
1341
|
* @param op - The op to process
|
|
1336
1342
|
* @param local - Whether the message originated from the local client
|
|
1337
1343
|
* @param localOpMetadata - For local client messages, this is the metadata that was submitted with the message.
|
|
1338
1344
|
* For messages from a remote client, this will be undefined.
|
|
1339
1345
|
*/
|
|
1340
|
-
processSetMessage(
|
|
1346
|
+
processSetMessage(msgEnvelope, op, value, local, localOpMetadata) {
|
|
1341
1347
|
this.throwIfDisposed();
|
|
1342
|
-
if (!this.isMessageForCurrentInstanceOfSubDirectory(
|
|
1348
|
+
if (!this.isMessageForCurrentInstanceOfSubDirectory(msgEnvelope, localOpMetadata?.subdir)) {
|
|
1343
1349
|
return;
|
|
1344
1350
|
}
|
|
1345
1351
|
const { key } = op;
|
|
@@ -1369,18 +1375,19 @@ class SubDirectory extends client_utils_1.TypedEventEmitter {
|
|
|
1369
1375
|
}
|
|
1370
1376
|
/**
|
|
1371
1377
|
* Process a create subdirectory operation.
|
|
1372
|
-
* @param
|
|
1378
|
+
* @param msgEnvelope - The envelope of the message from the server to apply.
|
|
1373
1379
|
* @param op - The op to process
|
|
1374
1380
|
* @param local - Whether the message originated from the local client
|
|
1375
1381
|
* @param localOpMetadata - For local client messages, this is the metadata that was submitted with the message.
|
|
1376
1382
|
* For messages from a remote client, this will be undefined.
|
|
1383
|
+
* @param clientSequenceNumber - The client sequence number of the message.
|
|
1377
1384
|
*/
|
|
1378
|
-
processCreateSubDirectoryMessage(
|
|
1385
|
+
processCreateSubDirectoryMessage(msgEnvelope, op, local, localOpMetadata, clientSequenceNumber) {
|
|
1379
1386
|
this.throwIfDisposed();
|
|
1380
|
-
if (!this.isMessageForCurrentInstanceOfSubDirectory(
|
|
1387
|
+
if (!this.isMessageForCurrentInstanceOfSubDirectory(msgEnvelope, localOpMetadata?.parentSubdir)) {
|
|
1381
1388
|
return;
|
|
1382
1389
|
}
|
|
1383
|
-
assertNonNullClientId(
|
|
1390
|
+
assertNonNullClientId(msgEnvelope.clientId);
|
|
1384
1391
|
let subDir;
|
|
1385
1392
|
if (local) {
|
|
1386
1393
|
const pendingEntryIndex = this.pendingSubDirectoryData.findIndex((entry) => entry.subdirName === op.subdirName);
|
|
@@ -1404,7 +1411,7 @@ class SubDirectory extends client_utils_1.TypedEventEmitter {
|
|
|
1404
1411
|
subDir = this.getOptimisticSubDirectory(op.subdirName, true);
|
|
1405
1412
|
if (subDir === undefined) {
|
|
1406
1413
|
const absolutePath = posix.join(this.absolutePath, op.subdirName);
|
|
1407
|
-
subDir = new SubDirectory({ seq:
|
|
1414
|
+
subDir = new SubDirectory({ seq: msgEnvelope.sequenceNumber, clientSeq: clientSequenceNumber }, new Set([msgEnvelope.clientId]), this.directory, this.runtime, this.serializer, absolutePath, this.mc.logger);
|
|
1408
1415
|
}
|
|
1409
1416
|
else {
|
|
1410
1417
|
// If the subdirectory already optimistically exists, we don't need to create it again.
|
|
@@ -1412,7 +1419,7 @@ class SubDirectory extends client_utils_1.TypedEventEmitter {
|
|
|
1412
1419
|
if (subDir.disposed) {
|
|
1413
1420
|
this.undisposeSubdirectoryTree(subDir);
|
|
1414
1421
|
}
|
|
1415
|
-
subDir.clientIds.add(
|
|
1422
|
+
subDir.clientIds.add(msgEnvelope.clientId);
|
|
1416
1423
|
}
|
|
1417
1424
|
this.registerEventsOnSubDirectory(subDir, op.subdirName);
|
|
1418
1425
|
this._sequencedSubdirectories.set(op.subdirName, subDir);
|
|
@@ -1424,23 +1431,23 @@ class SubDirectory extends client_utils_1.TypedEventEmitter {
|
|
|
1424
1431
|
// Ensure correct seqData. This can be necessary if in scenarios where a subdir was created, deleted, and
|
|
1425
1432
|
// then later recreated.
|
|
1426
1433
|
if (this.seqData.seq !== -1 &&
|
|
1427
|
-
this.seqData.seq <=
|
|
1434
|
+
this.seqData.seq <= msgEnvelope.sequenceNumber &&
|
|
1428
1435
|
subDir.seqData.seq === -1) {
|
|
1429
|
-
subDir.seqData.seq =
|
|
1430
|
-
subDir.seqData.clientSeq =
|
|
1436
|
+
subDir.seqData.seq = msgEnvelope.sequenceNumber;
|
|
1437
|
+
subDir.seqData.clientSeq = clientSequenceNumber;
|
|
1431
1438
|
}
|
|
1432
1439
|
}
|
|
1433
1440
|
/**
|
|
1434
1441
|
* Process a delete subdirectory operation.
|
|
1435
|
-
* @param
|
|
1442
|
+
* @param msgEnvelope - The envelope of the message from the server to apply.
|
|
1436
1443
|
* @param op - The op to process
|
|
1437
1444
|
* @param local - Whether the message originated from the local client
|
|
1438
1445
|
* @param localOpMetadata - For local client messages, this is the metadata that was submitted with the message.
|
|
1439
1446
|
* For messages from a remote client, this will be undefined.
|
|
1440
1447
|
*/
|
|
1441
|
-
processDeleteSubDirectoryMessage(
|
|
1448
|
+
processDeleteSubDirectoryMessage(msgEnvelope, op, local, localOpMetadata) {
|
|
1442
1449
|
this.throwIfDisposed();
|
|
1443
|
-
if (!this.isMessageForCurrentInstanceOfSubDirectory(
|
|
1450
|
+
if (!this.isMessageForCurrentInstanceOfSubDirectory(msgEnvelope, localOpMetadata?.parentSubdir)) {
|
|
1444
1451
|
return;
|
|
1445
1452
|
}
|
|
1446
1453
|
const previousValue = this._sequencedSubdirectories.get(op.subdirName);
|
|
@@ -1761,18 +1768,18 @@ class SubDirectory extends client_utils_1.TypedEventEmitter {
|
|
|
1761
1768
|
/**
|
|
1762
1769
|
* This return true if the message is for the current instance of this sub directory. As the sub directory
|
|
1763
1770
|
* can be deleted and created again, then this finds if the message is for current instance of directory or not.
|
|
1764
|
-
* @param
|
|
1771
|
+
* @param msgEnvelope - message envelope for the directory
|
|
1765
1772
|
* @param targetSubdir - subdirectory instance we are targeting from local op metadata (if a local op)
|
|
1766
1773
|
*/
|
|
1767
|
-
isMessageForCurrentInstanceOfSubDirectory(
|
|
1774
|
+
isMessageForCurrentInstanceOfSubDirectory(msgEnvelope, targetSubdir) {
|
|
1768
1775
|
// The message must be from this instance of the directory (if a local op) AND one of the following must be true:
|
|
1769
1776
|
// 1. The message was from the creator of this directory
|
|
1770
1777
|
// 2. This directory was created while detached
|
|
1771
1778
|
// 3. This directory was already live (known to other clients) and the op was created after the directory was created.
|
|
1772
1779
|
return ((targetSubdir === undefined || targetSubdir === this) &&
|
|
1773
|
-
((
|
|
1780
|
+
((msgEnvelope.clientId !== null && this.clientIds.has(msgEnvelope.clientId)) ||
|
|
1774
1781
|
this.clientIds.has("detached") ||
|
|
1775
|
-
(this.seqData.seq !== -1 && this.seqData.seq <=
|
|
1782
|
+
(this.seqData.seq !== -1 && this.seqData.seq <= msgEnvelope.referenceSequenceNumber)));
|
|
1776
1783
|
}
|
|
1777
1784
|
registerEventsOnSubDirectory(subDirectory, subDirName) {
|
|
1778
1785
|
subDirectory.on("subDirectoryCreated", (relativePath, local) => {
|