@glimt/record 0.0.28 → 0.0.30

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/record.js CHANGED
@@ -9385,6 +9385,15 @@ class DoubleLinkedList {
9385
9385
  }
9386
9386
  }
9387
9387
  const moveKey = (id, parentId) => `${id}@${parentId}`;
9388
+ function makeid(length = 8) {
9389
+ var result2 = "";
9390
+ var characters = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
9391
+ var charactersLength = characters.length;
9392
+ for (var i2 = 0; i2 < length; i2++) {
9393
+ result2 += characters.charAt(Math.floor(Math.random() * charactersLength));
9394
+ }
9395
+ return result2;
9396
+ }
9388
9397
  class MutationBuffer {
9389
9398
  constructor() {
9390
9399
  __publicField(this, "frozen", false);
@@ -9421,6 +9430,7 @@ class MutationBuffer {
9421
9430
  __publicField(this, "canvasManager");
9422
9431
  __publicField(this, "processedNodeManager");
9423
9432
  __publicField(this, "unattachedDoc");
9433
+ __publicField(this, "myId", makeid());
9424
9434
  __publicField(this, "stormBatches", []);
9425
9435
  __publicField(this, "stormInfo");
9426
9436
  __publicField(this, "stormSettings", {
@@ -9431,7 +9441,11 @@ class MutationBuffer {
9431
9441
  __publicField(this, "handleStormMutations", (muts) => {
9432
9442
  const time = Date.now();
9433
9443
  if (this.stormInfo == null) {
9434
- console.log("detected probable mutation storm start");
9444
+ console.log(
9445
+ "detected probable mutation storm start",
9446
+ "buffer id:",
9447
+ this.myId
9448
+ );
9435
9449
  this.stormInfo = {
9436
9450
  startedAt: time,
9437
9451
  totalMutations: 0,
@@ -9440,7 +9454,12 @@ class MutationBuffer {
9440
9454
  };
9441
9455
  }
9442
9456
  this.stormInfo.totalMutations += muts.length;
9443
- console.log("current storm mutations", this.stormInfo.totalMutations);
9457
+ console.log(
9458
+ "current storm mutations",
9459
+ this.stormInfo.totalMutations,
9460
+ "buffer id:",
9461
+ this.myId
9462
+ );
9444
9463
  if (this.stormInfo.totalMutations >= this.stormSettings.mutationLimit) {
9445
9464
  this.stormInfo.stormExceededLimit = true;
9446
9465
  this.stormBatches = [];
@@ -9463,7 +9482,12 @@ class MutationBuffer {
9463
9482
  "totalMutations:",
9464
9483
  this.stormInfo.totalMutations,
9465
9484
  "stormExceededLimit:",
9466
- stormExceededLimit
9485
+ stormExceededLimit,
9486
+ "storm duration:",
9487
+ Date.now() - this.stormInfo.startedAt,
9488
+ "ms",
9489
+ "buffer id:",
9490
+ this.myId
9467
9491
  );
9468
9492
  clearTimeout(this.stormInfo.timeout);
9469
9493
  this.stormInfo = null;
@@ -9494,7 +9518,9 @@ class MutationBuffer {
9494
9518
  performance.now() - start,
9495
9519
  "ms",
9496
9520
  "overrideStorm",
9497
- overrideStorm
9521
+ overrideStorm,
9522
+ "buffer id:",
9523
+ this.myId
9498
9524
  );
9499
9525
  this.emit();
9500
9526
  });