@mdbase-dev/sdk 0.1.0-beta.179 → 0.1.0-beta.181

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.
@@ -44428,6 +44428,18 @@ ${end.comment}` : end.comment;
44428
44428
  return "unavailable";
44429
44429
  }
44430
44430
  }
44431
+ /** Whether the replica on this device holds anything from the log. Every
44432
+ * log starts with the entries that admitted this device, so a replica
44433
+ * that knows no head is empty (its storage was lost), not up to date. */
44434
+ holdsLog() {
44435
+ try {
44436
+ if (!this.native) return false;
44437
+ const status = this.native.observations().status;
44438
+ return status.mode === "local_only" || status.headKnown > 0;
44439
+ } catch {
44440
+ return false;
44441
+ }
44442
+ }
44431
44443
  /** Diagnostics while waiting for a key (native sync status), else null. */
44432
44444
  keyWaitDetail() {
44433
44445
  try {
@@ -44534,6 +44546,7 @@ ${end.comment}` : end.comment;
44534
44546
  this.checkCollection(signal);
44535
44547
  if (!this.native || !this.collectionScope || this.adoptedEndpoint === null || !Number.isSafeInteger(timeoutMs) || timeoutMs < 1 || timeoutMs > 15e3 || typeof cold !== "boolean" || typeof local !== "boolean" || cold && (local || !this.pump))
44536
44548
  throw fail16("binding");
44549
+ if (local && !this.holdsLog()) return Promise.reject(fail16("unavailable"));
44537
44550
  if (this.readWork)
44538
44551
  return this.readWork.then(() => {
44539
44552
  this.checkCollection(signal);
@@ -45560,7 +45573,13 @@ ${end.comment}` : end.comment;
45560
45573
  report("opening_store");
45561
45574
  await host.openCollectionSql({ signal: life.signal, replicaId: receipt4.deviceId, endpoint: 0, openSql: openLedgerSql });
45562
45575
  check3();
45563
- const localFirst = !isPrivate && await ledger.syncedBefore({ signal: life.signal });
45576
+ let holdsLog = true;
45577
+ try {
45578
+ holdsLog = host.holdsLog?.() ?? true;
45579
+ } catch {
45580
+ holdsLog = false;
45581
+ }
45582
+ const localFirst = !isPrivate && holdsLog && await ledger.syncedBefore({ signal: life.signal });
45564
45583
  check3();
45565
45584
  const connectLog = async () => {
45566
45585
  report("connecting_log");
@@ -50033,12 +50052,12 @@ ${end.comment}` : end.comment;
50033
50052
  // src/application/asset-pins.json
50034
50053
  var asset_pins_default = {
50035
50054
  runtime: {
50036
- sha256: "be17475e2ca164642fb5b29b4bf003c03ad9a8dbacd8aebc135dad7e91b73585",
50037
- bytes: 3849256,
50038
- maxBytes: 3849256,
50055
+ sha256: "668e02fd1a8b043dc69f7b090dc5350f1373dce28dbe3a225dd3630766d9bfbe",
50056
+ bytes: 385e4,
50057
+ maxBytes: 385e4,
50039
50058
  source: {
50040
50059
  repository: "mdbase-dev/mdbase-connect",
50041
- commit: "323d30aff40fc6f3f172d44f60cd7e67bb17d977"
50060
+ commit: "444da67fe8a80aa4e06ab605edfe8393ee348071"
50042
50061
  }
50043
50062
  },
50044
50063
  sqlite: {