@liveblocks/core 2.15.0-debug1 → 2.15.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/dist/index.d.mts +2 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +5 -28
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +5 -28
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -6,7 +6,7 @@ var __export = (target, all) => {
|
|
|
6
6
|
|
|
7
7
|
// src/version.ts
|
|
8
8
|
var PKG_NAME = "@liveblocks/core";
|
|
9
|
-
var PKG_VERSION = "2.15.
|
|
9
|
+
var PKG_VERSION = "2.15.1";
|
|
10
10
|
var PKG_FORMAT = "esm";
|
|
11
11
|
|
|
12
12
|
// src/dupe-detection.ts
|
|
@@ -2668,7 +2668,7 @@ var ManagedSocket = class {
|
|
|
2668
2668
|
#machine;
|
|
2669
2669
|
#cleanups;
|
|
2670
2670
|
events;
|
|
2671
|
-
constructor(delegates, enableDebugLogging =
|
|
2671
|
+
constructor(delegates, enableDebugLogging = false, waitForActorId = true) {
|
|
2672
2672
|
const { machine, events, cleanups } = createConnectionStateMachine(
|
|
2673
2673
|
delegates,
|
|
2674
2674
|
{ waitForActorId, enableDebugLogging }
|
|
@@ -3318,6 +3318,9 @@ var AbstractSignal = class {
|
|
|
3318
3318
|
removeSink(sink) {
|
|
3319
3319
|
this[kSinks].delete(sink);
|
|
3320
3320
|
}
|
|
3321
|
+
asReadonly() {
|
|
3322
|
+
return this;
|
|
3323
|
+
}
|
|
3321
3324
|
};
|
|
3322
3325
|
var Signal = class extends AbstractSignal {
|
|
3323
3326
|
#value;
|
|
@@ -6269,25 +6272,6 @@ function createRoom(options, config) {
|
|
|
6269
6272
|
// Debug
|
|
6270
6273
|
opStackTraces: process.env.NODE_ENV !== "production" ? /* @__PURE__ */ new Map() : void 0
|
|
6271
6274
|
};
|
|
6272
|
-
function printPending(cs) {
|
|
6273
|
-
if (cs) globalThis.console.log(`[debug] at ${cs}`);
|
|
6274
|
-
if (context.unacknowledgedOps.size === 0) {
|
|
6275
|
-
globalThis.console.log("[debug] no pending ops");
|
|
6276
|
-
} else {
|
|
6277
|
-
globalThis.console.log(
|
|
6278
|
-
`[debug] pending ops (${context.unacknowledgedOps.size}):`
|
|
6279
|
-
);
|
|
6280
|
-
for (const [opId, op] of context.unacknowledgedOps) {
|
|
6281
|
-
globalThis.console.log(
|
|
6282
|
-
"[debug] opid=",
|
|
6283
|
-
opId,
|
|
6284
|
-
"op=",
|
|
6285
|
-
JSON.stringify(op)
|
|
6286
|
-
);
|
|
6287
|
-
}
|
|
6288
|
-
}
|
|
6289
|
-
globalThis.console.log("[debug] storage status", getStorageStatus());
|
|
6290
|
-
}
|
|
6291
6275
|
let lastTokenKey;
|
|
6292
6276
|
function onStatusDidChange(newStatus) {
|
|
6293
6277
|
const authValue = managedSocket.authValue;
|
|
@@ -6590,7 +6574,6 @@ function createRoom(options, config) {
|
|
|
6590
6574
|
);
|
|
6591
6575
|
}
|
|
6592
6576
|
function applyOps(rawOps, isLocal) {
|
|
6593
|
-
printPending("start of applyOps");
|
|
6594
6577
|
const output = {
|
|
6595
6578
|
reverse: [],
|
|
6596
6579
|
storageUpdates: /* @__PURE__ */ new Map(),
|
|
@@ -6633,9 +6616,6 @@ function createRoom(options, config) {
|
|
|
6633
6616
|
nn(context.opStackTraces).delete(opId);
|
|
6634
6617
|
}
|
|
6635
6618
|
const deleted = context.unacknowledgedOps.delete(opId);
|
|
6636
|
-
if (deleted) {
|
|
6637
|
-
globalThis.console.log("[debug] acked", opId);
|
|
6638
|
-
}
|
|
6639
6619
|
source = deleted ? 2 /* ACK */ : 1 /* REMOTE */;
|
|
6640
6620
|
}
|
|
6641
6621
|
const applyOpResult = applyOp(op, source);
|
|
@@ -6657,7 +6637,6 @@ function createRoom(options, config) {
|
|
|
6657
6637
|
}
|
|
6658
6638
|
}
|
|
6659
6639
|
}
|
|
6660
|
-
printPending("end of applyOps");
|
|
6661
6640
|
return {
|
|
6662
6641
|
ops,
|
|
6663
6642
|
reverse: output.reverse,
|
|
@@ -6969,7 +6948,6 @@ ${Array.from(traces).join("\n\n")}`
|
|
|
6969
6948
|
for (const op of storageOps) {
|
|
6970
6949
|
context.unacknowledgedOps.set(nn(op.opId), op);
|
|
6971
6950
|
}
|
|
6972
|
-
printPending("flushNowOrSoon");
|
|
6973
6951
|
notifyStorageStatus();
|
|
6974
6952
|
}
|
|
6975
6953
|
if (managedSocket.getStatus() !== "connected") {
|
|
@@ -7059,7 +7037,6 @@ ${Array.from(traces).join("\n\n")}`
|
|
|
7059
7037
|
let _getStorage$ = null;
|
|
7060
7038
|
let _resolveStoragePromise = null;
|
|
7061
7039
|
function processInitialStorage(message) {
|
|
7062
|
-
printPending("initial local ops");
|
|
7063
7040
|
const unacknowledgedOps = new Map(context.unacknowledgedOps);
|
|
7064
7041
|
createOrUpdateRootFromMessage(message);
|
|
7065
7042
|
applyAndSendOps(unacknowledgedOps);
|