@peerbit/shared-log 13.2.36 → 14.0.0

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": "@peerbit/shared-log",
3
- "version": "13.2.36",
3
+ "version": "14.0.0",
4
4
  "description": "Shared log",
5
5
  "sideEffects": false,
6
6
  "type": "module",
@@ -62,23 +62,23 @@
62
62
  "pidusage": "^4.0.1",
63
63
  "pino": "^9.4.0",
64
64
  "uint8arrays": "^5.1.0",
65
- "@peerbit/blocks": "4.2.10",
66
65
  "@peerbit/any-store": "2.2.14",
67
- "@peerbit/cache": "3.1.1",
68
66
  "@peerbit/blocks-interface": "2.1.5",
67
+ "@peerbit/cache": "3.1.1",
68
+ "@peerbit/blocks": "4.2.10",
69
69
  "@peerbit/crypto": "3.1.5",
70
70
  "@peerbit/diagnostics": "0.0.1",
71
+ "@peerbit/indexer-sqlite3": "3.0.14",
71
72
  "@peerbit/indexer-interface": "3.0.9",
72
73
  "@peerbit/log": "6.2.17",
73
- "@peerbit/indexer-sqlite3": "3.0.14",
74
+ "@peerbit/pubsub": "5.4.1",
74
75
  "@peerbit/logger": "2.0.1",
75
76
  "@peerbit/program": "6.0.49",
77
+ "@peerbit/pubsub-interface": "5.2.1",
76
78
  "@peerbit/riblt": "1.2.0",
77
- "@peerbit/pubsub": "5.4.1",
78
79
  "@peerbit/rpc": "6.1.17",
79
- "@peerbit/time": "3.0.1",
80
80
  "@peerbit/stream-interface": "6.0.15",
81
- "@peerbit/pubsub-interface": "5.2.1"
81
+ "@peerbit/time": "3.0.1"
82
82
  },
83
83
  "optionalDependencies": {
84
84
  "@peerbit/shared-log-rust": "0.1.4",
@@ -89,9 +89,9 @@
89
89
  "@types/pidusage": "^2.0.5",
90
90
  "uuid": "^11.1.1",
91
91
  "@peerbit/any-store-rust": "0.1.4",
92
+ "@peerbit/indexer-rust": "1.0.7",
92
93
  "@peerbit/test-utils": "3.1.23",
93
- "peerbit": "5.3.23",
94
- "@peerbit/indexer-rust": "1.0.7"
94
+ "peerbit": "5.3.23"
95
95
  },
96
96
  "repository": {
97
97
  "type": "git",
package/src/errors.ts CHANGED
@@ -27,6 +27,25 @@ export class NoPeersError extends Error {
27
27
  }
28
28
  }
29
29
 
30
+ /**
31
+ * The `compatibility` open option was removed: the pre-v10 replication-info
32
+ * network compatibility modes are retired. Any explicitly provided value —
33
+ * including 10, which previously behaved like the default — rejects before
34
+ * open() performs any side effect. Omit the option (or pass `undefined`) to
35
+ * open in the only supported mode. Document-level `compatibility: 6|7` mapped
36
+ * onto this option and is rejected at the document layer with its own error.
37
+ */
38
+ export class CompatibilityModeRetiredError extends Error {
39
+ constructor(value: unknown) {
40
+ super(
41
+ `The SharedLog "compatibility" open option was removed: replication-info network compatibility modes are retired. ` +
42
+ `Received explicit value ${String(value)}; remove the option to open this log ` +
43
+ `(documents previously used compatibility 6/7, which mapped onto this option and is rejected at the document layer).`,
44
+ );
45
+ this.name = "CompatibilityModeRetiredError";
46
+ }
47
+ }
48
+
30
49
  /**
31
50
  * The native transaction committed hot/runtime facts before its entry block
32
51
  * could be mirrored to durable storage. Lower-log publication is held behind
package/src/index.ts CHANGED
@@ -144,6 +144,7 @@ import {
144
144
  debouncedAccumulatorMap,
145
145
  } from "./debounce.js";
146
146
  import {
147
+ CompatibilityModeRetiredError,
147
148
  NativeDurableCommitError,
148
149
  NoPeersError,
149
150
  isNotStartedError,
@@ -428,6 +429,7 @@ export {
428
429
  EntryReplicatedU32,
429
430
  EntryReplicatedU64,
430
431
  type CoverRange,
432
+ CompatibilityModeRetiredError,
431
433
  NativeDurableCommitError,
432
434
  NoPeersError,
433
435
  };
@@ -1248,7 +1250,6 @@ export type SharedLogOptions<
1248
1250
  waitForPruneDelay?: number;
1249
1251
  distributionDebounceTime?: number;
1250
1252
  strictFullReplicaFallback?: boolean;
1251
- compatibility?: number;
1252
1253
  domain?: ReplicationDomainConstructor<D>;
1253
1254
  eagerBlocks?: EagerBlocksSetting;
1254
1255
  fanout?: SharedLogFanoutOptions;
@@ -3760,7 +3761,10 @@ export class SharedLog<
3760
3761
  }
3761
3762
 
3762
3763
  get compatibility(): number | undefined {
3763
- return this._logProperties?.compatibility;
3764
+ // B12: the open option was removed and any defined value rejects at
3765
+ // open(); this is permanently undefined and dies with the residual
3766
+ // gates in a later cleanup stage.
3767
+ return (this._logProperties as any)?.compatibility;
3764
3768
  }
3765
3769
 
3766
3770
  /**
@@ -14166,6 +14170,17 @@ export class SharedLog<
14166
14170
  }
14167
14171
 
14168
14172
  async open(options?: Args<T, D, R>): Promise<void> {
14173
+ // B12: replication-info network compatibility modes are retired. Read the
14174
+ // RAW argument value (the option no longer exists on the type) so untyped
14175
+ // JS callers cannot smuggle a value past the removed field, and reject
14176
+ // ANY defined value — including 10, which previously behaved like the
14177
+ // default — BEFORE any open-time side effect (rpc.open, index/native
14178
+ // setup, domain resolution, synchronizer creation, subscription setup).
14179
+ // An explicitly-present `undefined` stays accepted.
14180
+ const rawCompatibility = (options as any)?.compatibility;
14181
+ if (rawCompatibility !== undefined) {
14182
+ throw new CompatibilityModeRetiredError(rawCompatibility);
14183
+ }
14169
14184
  this.ensureNativeDurabilityRuntimeState();
14170
14185
  this._nativeStrictDurableTransactionsClosing = false;
14171
14186
  this._replicationRangeMutationsClosing = false;
@@ -14227,7 +14242,8 @@ export class SharedLog<
14227
14242
  this.domain = options?.domain
14228
14243
  ? (options.domain(this) as unknown as D)
14229
14244
  : (createReplicationDomainHash(
14230
- options?.compatibility !== undefined && options.compatibility < 10
14245
+ (options as any)?.compatibility !== undefined &&
14246
+ (options as any).compatibility < 10
14231
14247
  ? "u32"
14232
14248
  : "u64",
14233
14249
  )(this) as unknown as D);
@@ -14837,7 +14853,7 @@ export class SharedLog<
14837
14853
  sendOptions?: { priority?: number; signal?: AbortSignal },
14838
14854
  ) => this.trySendFusedRawExchangeHeads(hashes, to, sendOptions),
14839
14855
  warn,
14840
- compatibility: this._logProperties?.compatibility,
14856
+ compatibility: (this._logProperties as any)?.compatibility,
14841
14857
  resolution: this.domain.resolution,
14842
14858
  sync: options?.sync,
14843
14859
  syncronizer: options?.syncronizer,