@bjornpagen/bumbledb-log 0.19.0 → 0.19.2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bjornpagen/bumbledb-log",
3
- "version": "0.19.0",
3
+ "version": "0.19.2",
4
4
  "description": "Braided object-store replication for bumbledb: the command codec, theory-derived braids, and replica/writer over five store verbs",
5
5
  "type": "module",
6
6
  "exports": {
@@ -37,7 +37,7 @@
37
37
  "arkregex": "^0.0.8"
38
38
  },
39
39
  "peerDependencies": {
40
- "@bjornpagen/bumbledb": "^0.19.0"
40
+ "@bjornpagen/bumbledb": "^0.19.2"
41
41
  },
42
42
  "devDependencies": {
43
43
  "@biomejs/biome": "2.5.4",
package/src/store.ts CHANGED
@@ -105,7 +105,7 @@ interface LeaseFile {
105
105
  }
106
106
 
107
107
  /** Ceiling of the jittered wait between probes of an unexpired lease. */
108
- const LEASE_RETRY_MS = 10
108
+ const LOCK_RETRY_MS = 10
109
109
 
110
110
  /** Mutation-lease lifetime: long enough for one verb, short enough to expire after a crash. */
111
111
  const MUTATION_LEASE_MS = 30_000
@@ -359,7 +359,7 @@ async function acquireFsLease(
359
359
  throw errors.new("replica directory has an owner")
360
360
  }
361
361
  await new Promise(function later(resolve) {
362
- setTimeout(resolve, Math.random() * LEASE_RETRY_MS)
362
+ setTimeout(resolve, Math.random() * LOCK_RETRY_MS)
363
363
  })
364
364
  continue
365
365
  }
package/src/writer.ts CHANGED
@@ -27,7 +27,7 @@ import {
27
27
  import * as errors from "@superbuilders/errors"
28
28
  import { regex } from "arkregex"
29
29
  import type { Digest32 } from "#bytes.ts"
30
- import { bytesEqual, checkedAddU64, digest32, digest32FromHex, utf8Encoder, utf8StrictDecoder } from "#bytes.ts"
30
+ import { bytesEqual, checkedAddU64, digest32, utf8Encoder, utf8StrictDecoder } from "#bytes.ts"
31
31
  import { chainSum } from "#chain.ts"
32
32
  import type { Op } from "#codec.ts"
33
33
  import { decodeBatch, encodeBatch } from "#codec.ts"
@@ -570,7 +570,7 @@ async function disciplineCommit<Rels extends SchemaRelations>(
570
570
  const bytes = encodeBatch(
571
571
  core.descriptor,
572
572
  {
573
- fingerprint: digest32FromHex(core.descriptor.fingerprint),
573
+ fingerprint: digest32(core.descriptor.fingerprintBytes),
574
574
  braid,
575
575
  braidGen: generation(entry.g + 1n),
576
576
  prev: digestPrev(entry.prev),
@@ -862,7 +862,7 @@ async function openWriter<Rels extends SchemaRelations>(
862
862
  if (isReplica(source)) {
863
863
  return writerOn(source)
864
864
  }
865
- await birthStore(source.store, source.prefix, digest32FromHex(descriptorOf(source.theory).fingerprint))
865
+ await birthStore(source.store, source.prefix, digest32(descriptorOf(source.theory).fingerprintBytes))
866
866
  return writerOn(await openReplica(source))
867
867
  }
868
868