@glimt/record 0.0.29 → 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.cjs +27 -4
- package/dist/record.cjs.map +1 -1
- package/dist/record.js +27 -4
- package/dist/record.js.map +1 -1
- package/dist/record.umd.cjs +27 -4
- package/dist/record.umd.cjs.map +2 -2
- package/dist/record.umd.min.cjs +1 -1
- package/dist/record.umd.min.cjs.map +3 -3
- package/package.json +1 -1
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(
|
|
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(
|
|
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 = [];
|
|
@@ -9466,7 +9485,9 @@ class MutationBuffer {
|
|
|
9466
9485
|
stormExceededLimit,
|
|
9467
9486
|
"storm duration:",
|
|
9468
9487
|
Date.now() - this.stormInfo.startedAt,
|
|
9469
|
-
"ms"
|
|
9488
|
+
"ms",
|
|
9489
|
+
"buffer id:",
|
|
9490
|
+
this.myId
|
|
9470
9491
|
);
|
|
9471
9492
|
clearTimeout(this.stormInfo.timeout);
|
|
9472
9493
|
this.stormInfo = null;
|
|
@@ -9497,7 +9518,9 @@ class MutationBuffer {
|
|
|
9497
9518
|
performance.now() - start,
|
|
9498
9519
|
"ms",
|
|
9499
9520
|
"overrideStorm",
|
|
9500
|
-
overrideStorm
|
|
9521
|
+
overrideStorm,
|
|
9522
|
+
"buffer id:",
|
|
9523
|
+
this.myId
|
|
9501
9524
|
);
|
|
9502
9525
|
this.emit();
|
|
9503
9526
|
});
|