@peerbit/shared-log
Advanced tools
Comparing version 10.3.0 to 10.3.1-63e24d5
@@ -13,3 +13,3 @@ import { PublicSignKey } from "@peerbit/crypto"; | ||
import { PIDReplicationController } from "./pid.js"; | ||
import { type EntryReplicated, EntryReplicatedU32, EntryReplicatedU64, type ReplicationChange, type ReplicationChanges, ReplicationIntent, type ReplicationRangeIndexable, SyncStatus } from "./ranges.js"; | ||
import { type EntryReplicated, EntryReplicatedU32, EntryReplicatedU64, type ReplicationChange, type ReplicationChanges, ReplicationIntent, type ReplicationRangeIndexable } from "./ranges.js"; | ||
import { type ReplicationDomainHash, createReplicationDomainHash } from "./replication-domain-hash.js"; | ||
@@ -189,5 +189,6 @@ import { type ReplicationDomainTime, createReplicationDomainTime } from "./replication-domain-time.js"; | ||
checkDuplicates?: boolean; | ||
rebalance?: boolean; | ||
mergeSegments?: boolean; | ||
announce?: (msg: AllReplicatingSegmentsMessage | AddedReplicationSegmentMessage) => void; | ||
}): Promise<ReplicationRangeIndexable<R>[] | undefined>; | ||
}): Promise<ReplicationRangeIndexable<R>[]>; | ||
unreplicate(rangeOrEntry?: Entry<T> | { | ||
@@ -202,9 +203,9 @@ id: Uint8Array; | ||
startAnnounceReplicating(range: ReplicationRangeIndexable<R>[], options?: { | ||
syncStatus?: SyncStatus; | ||
reset?: boolean; | ||
checkDuplicates?: boolean; | ||
rebalance?: boolean; | ||
announce?: (msg: AllReplicatingSegmentsMessage | AddedReplicationSegmentMessage) => void; | ||
}): Promise<void>; | ||
private removePeerFromGidPeerHistory; | ||
private addPeersToGidPeerHistory; | ||
addPeersToGidPeerHistory(gid: string, publicKeys: Iterable<string>, reset?: boolean): Set<string>; | ||
append(data: T, options?: SharedAppendOptions<T> | undefined): Promise<{ | ||
@@ -307,3 +308,3 @@ entry: Entry<T>; | ||
clearCache?: boolean; | ||
}): Promise<void>; | ||
}): Promise<false | undefined>; | ||
waitForPruned(): Promise<void>; | ||
@@ -310,0 +311,0 @@ onReplicationChange(changeOrChanges: ReplicationChanges<ReplicationRangeIndexable<R>> | ReplicationChanges<ReplicationRangeIndexable<R>>[]): Promise<false | undefined>; |
@@ -10,6 +10,2 @@ import type { Cache } from "@peerbit/cache"; | ||
} | ||
export declare enum SyncStatus { | ||
Unsynced = 0, | ||
Synced = 1 | ||
} | ||
export declare const shouldAssigneToRangeBoundary: (leaders: Map<string, { | ||
@@ -16,0 +12,0 @@ intersecting: boolean; |
@@ -13,2 +13,3 @@ import { Cache } from "@peerbit/cache"; | ||
import { SimpleSyncronizer } from "./simple.js"; | ||
export declare const logger: import("pino").Logger<never>; | ||
type NumberOrBigint = number | bigint; | ||
@@ -15,0 +16,0 @@ declare class SymbolSerialized implements SSymbol { |
@@ -14,2 +14,3 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { | ||
import {} from "@peerbit/indexer-interface"; | ||
import { logger as loggerFn } from "@peerbit/logger"; | ||
import { DecoderWrapper, EncoderWrapper } from "@peerbit/riblt"; | ||
@@ -22,2 +23,3 @@ import { SilentDelivery } from "@peerbit/stream-interface"; | ||
import { SimpleSyncronizer } from "./simple.js"; | ||
export const logger = loggerFn({ module: "shared-log" }); | ||
const coerceBigInt = (value) => typeof value === "bigint" ? value : BigInt(value); | ||
@@ -379,3 +381,14 @@ class SymbolSerialized { | ||
} | ||
decoder.try_decode(); | ||
try { | ||
decoder.try_decode(); | ||
} | ||
catch (error) { | ||
if (error?.message === "Invalid degree") { | ||
logger.error(error?.message); | ||
return false; | ||
} | ||
else { | ||
throw error; | ||
} | ||
} | ||
count += message.symbols.length; | ||
@@ -382,0 +395,0 @@ if (decoder.decoded()) { |
140
package.json
{ | ||
"name": "@peerbit/shared-log", | ||
"version": "10.3.0", | ||
"description": "Shared log", | ||
"sideEffects": false, | ||
"type": "module", | ||
"types": "./dist/src/index.d.ts", | ||
"typesVersions": { | ||
"*": { | ||
"*": [ | ||
"*", | ||
"dist/*", | ||
"dist/src/*", | ||
"dist/src/*/index" | ||
], | ||
"src/*": [ | ||
"*", | ||
"dist/*", | ||
"dist/src/*", | ||
"dist/src/*/index" | ||
] | ||
} | ||
}, | ||
"files": [ | ||
"src", | ||
"dist", | ||
"!dist/e2e", | ||
"!dist/test", | ||
"!**/*.tsbuildinfo" | ||
], | ||
"exports": { | ||
".": { | ||
"types": "./dist/src/index.d.ts", | ||
"import": "./dist/src/index.js" | ||
} | ||
}, | ||
"eslintConfig": { | ||
"extends": "peerbit", | ||
"parserOptions": { | ||
"project": true, | ||
"sourceType": "module" | ||
}, | ||
"ignorePatterns": [ | ||
"!.aegir.js", | ||
"test/ts-use", | ||
"*.d.ts" | ||
] | ||
}, | ||
"publishConfig": { | ||
"access": "public" | ||
}, | ||
"scripts": { | ||
"clean": "aegir clean", | ||
"build": "aegir build --no-bundle", | ||
"test": "aegir test --target node", | ||
"lint": "aegir lint" | ||
}, | ||
"author": "dao.xyz", | ||
"license": "MIT", | ||
"dependencies": { | ||
"@dao-xyz/borsh": "^5.2.3", | ||
"@peerbit/logger": "1.0.3", | ||
"@peerbit/program": "5.1.1", | ||
"@peerbit/log": "4.0.26", | ||
"@peerbit/rpc": "5.0.24", | ||
"@peerbit/time": "2.0.7", | ||
"@peerbit/riblt": "1.0.4" | ||
}, | ||
"devDependencies": { | ||
"@peerbit/test-utils": "^2.1.14" | ||
} | ||
"name": "@peerbit/shared-log", | ||
"version": "10.3.1-63e24d5", | ||
"description": "Shared log", | ||
"sideEffects": false, | ||
"type": "module", | ||
"types": "./dist/src/index.d.ts", | ||
"typesVersions": { | ||
"*": { | ||
"*": [ | ||
"*", | ||
"dist/*", | ||
"dist/src/*", | ||
"dist/src/*/index" | ||
], | ||
"src/*": [ | ||
"*", | ||
"dist/*", | ||
"dist/src/*", | ||
"dist/src/*/index" | ||
] | ||
} | ||
}, | ||
"files": [ | ||
"src", | ||
"dist", | ||
"!dist/e2e", | ||
"!dist/test", | ||
"!**/*.tsbuildinfo" | ||
], | ||
"exports": { | ||
".": { | ||
"types": "./dist/src/index.d.ts", | ||
"import": "./dist/src/index.js" | ||
} | ||
}, | ||
"eslintConfig": { | ||
"extends": "peerbit", | ||
"parserOptions": { | ||
"project": true, | ||
"sourceType": "module" | ||
}, | ||
"ignorePatterns": [ | ||
"!.aegir.js", | ||
"test/ts-use", | ||
"*.d.ts" | ||
] | ||
}, | ||
"publishConfig": { | ||
"access": "public" | ||
}, | ||
"scripts": { | ||
"clean": "aegir clean", | ||
"build": "aegir build --no-bundle", | ||
"test": "aegir test --target node", | ||
"lint": "aegir lint" | ||
}, | ||
"author": "dao.xyz", | ||
"license": "MIT", | ||
"dependencies": { | ||
"@dao-xyz/borsh": "^5.2.3", | ||
"@peerbit/logger": "1.0.3-63e24d5", | ||
"@peerbit/program": "5.1.1-63e24d5", | ||
"@peerbit/log": "4.0.27-63e24d5", | ||
"@peerbit/rpc": "5.0.25-63e24d5", | ||
"@peerbit/time": "2.0.7-63e24d5", | ||
"@peerbit/riblt": "1.0.4-63e24d5" | ||
}, | ||
"devDependencies": { | ||
"@peerbit/test-utils": "2.1.15-63e24d5" | ||
} | ||
} |
@@ -16,5 +16,4 @@ import { field, variant } from "@dao-xyz/borsh"; | ||
super(); | ||
this.message = message; | ||
} | ||
} |
@@ -46,7 +46,2 @@ import { deserialize, field, serialize, variant, vec } from "@dao-xyz/borsh"; | ||
export enum SyncStatus { | ||
Unsynced = 0, | ||
Synced = 1, | ||
} | ||
const min = (a: number | bigint, b: number | bigint) => (a < b ? a : b); | ||
@@ -1901,3 +1896,2 @@ | ||
/* let missingForCursors: NumberFromType<R>[] = [] */ | ||
let uniqueVisited = new Set<string>(); | ||
@@ -1967,2 +1961,3 @@ for (let i = 0; i < cursor.length; i++) { | ||
} */ | ||
return leaders; | ||
@@ -2283,2 +2278,5 @@ }; | ||
(result) => { | ||
if (result.size === 0) { | ||
return; | ||
} | ||
return fn([...result.values()]); | ||
@@ -2457,8 +2455,2 @@ }, | ||
const entries = await iterator.all(); // TODO choose right batch sizes here for optimal memory usage / speed | ||
/* const grouped = await groupByGidSync(entries.map((x) => x.value)); | ||
for (const [gid, entries] of grouped.entries()) { | ||
yield { gid, entries }; | ||
} */ | ||
for (const entry of entries) { | ||
@@ -2465,0 +2457,0 @@ yield entry.value; |
@@ -6,2 +6,3 @@ import { field, variant, vec } from "@dao-xyz/borsh"; | ||
import type { Entry, Log } from "@peerbit/log"; | ||
import { logger as loggerFn } from "@peerbit/logger"; | ||
import { DecoderWrapper, EncoderWrapper } from "@peerbit/riblt"; | ||
@@ -21,2 +22,4 @@ import type { RPC, RequestContext } from "@peerbit/rpc"; | ||
export const logger = loggerFn({ module: "shared-log" }); | ||
type NumberOrBigint = number | bigint; | ||
@@ -475,3 +478,12 @@ | ||
} | ||
decoder.try_decode(); | ||
try { | ||
decoder.try_decode(); | ||
} catch (error: any) { | ||
if (error?.message === "Invalid degree") { | ||
logger.error(error?.message); | ||
return false; | ||
} else { | ||
throw error; | ||
} | ||
} | ||
count += message.symbols.length; | ||
@@ -478,0 +490,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
845002
16243
2
+ Added@peerbit/any-store@2.1.3-63e24d5(transitive)
+ Added@peerbit/any-store-interface@1.0.0-63e24d5(transitive)
+ Added@peerbit/any-store-opfs@1.0.3-63e24d5(transitive)
+ Added@peerbit/blocks-interface@1.3.9-63e24d5(transitive)
+ Added@peerbit/cache@2.1.1-63e24d5(transitive)
+ Added@peerbit/crypto@2.3.3-63e24d5(transitive)
+ Added@peerbit/indexer-interface@2.0.4-63e24d5(transitive)
+ Added@peerbit/indexer-simple@1.1.7-63e24d5(transitive)
+ Added@peerbit/keychain@1.0.21-63e24d5(transitive)
+ Added@peerbit/log@4.0.27-63e24d5(transitive)
+ Added@peerbit/logger@1.0.3-63e24d5(transitive)
+ Added@peerbit/program@5.1.1-63e24d5(transitive)
+ Added@peerbit/pubsub-interface@3.1.2-63e24d5(transitive)
+ Added@peerbit/riblt@1.0.4-63e24d5(transitive)
+ Added@peerbit/rpc@5.0.25-63e24d5(transitive)
+ Added@peerbit/stream-interface@5.1.2-63e24d5(transitive)
+ Added@peerbit/time@2.0.7-63e24d5(transitive)
- Removed@peerbit/any-store@2.1.5(transitive)
- Removed@peerbit/any-store-interface@1.0.0(transitive)
- Removed@peerbit/any-store-opfs@1.0.5(transitive)
- Removed@peerbit/blocks-interface@1.3.12(transitive)
- Removed@peerbit/cache@2.1.12.1.2(transitive)
- Removed@peerbit/crypto@2.3.32.3.5(transitive)
- Removed@peerbit/indexer-interface@2.0.6(transitive)
- Removed@peerbit/indexer-simple@1.1.9(transitive)
- Removed@peerbit/keychain@1.0.23(transitive)
- Removed@peerbit/log@4.0.26(transitive)
- Removed@peerbit/logger@1.0.3(transitive)
- Removed@peerbit/program@5.1.1(transitive)
- Removed@peerbit/pubsub-interface@3.1.4(transitive)
- Removed@peerbit/riblt@1.0.4(transitive)
- Removed@peerbit/rpc@5.0.24(transitive)
- Removed@peerbit/stream-interface@5.1.4(transitive)
- Removed@peerbit/time@2.0.72.0.8(transitive)
Updated@peerbit/log@4.0.27-63e24d5
Updated@peerbit/riblt@1.0.4-63e24d5
Updated@peerbit/rpc@5.0.25-63e24d5
Updated@peerbit/time@2.0.7-63e24d5