Area
Wallet
Affected package or service and version
@bsv/wallet-toolbox — src/sdk/WalletStorage.interfaces.ts:718, src/storage/WalletStorageManager.ts. Current on main at 82ab4d3c.
Defect
ProcessSyncChunkResult declares an error member:
// WalletStorage.interfaces.ts:718
error?: WalletError
No consumer reads it and no producer sets it:
- Both chunk loops in
WalletStorageManager (syncToWriter, syncFromReader) consume r.inserts, r.updates, r.done and r.nextCheckpoint. Occurrences of r.error in that file: 0.
EntitySyncState.processSyncChunk's declared return type is { done, maxUpdated_at, updates, inserts } — no error member at all — and StorageProvider.processSyncChunk returns that plus nextCheckpoint. So the local path cannot populate it.
StorageClientBase.processSyncChunk deserializes whatever the server returned into the same interface, but the server calls the same StorageProvider method, so it cannot populate it either.
- For cross-implementation confirmation,
go-wallet-toolbox's ProcessSyncChunkResult struct is Done / MaxUpdatedAt / Updates / Inserts with no Error field; Go propagates failures through its ordinary error return.
So the field is declared in one implementation, absent in the other, never set by either, and read by nobody.
Minimal reproduction
Static: grep -c "r\.error" src/storage/WalletStorageManager.ts → 0, while error?: WalletError is declared on the interface.
Expected behavior
Either remove the field, or specify who sets it and have both loops act on it. As written it is a declared failure channel that silently does nothing.
Actual behavior and evidence
A third-party writer implementing this interface could reasonably populate error to report a non-throwing failure, and both loops would ignore it: neither sets done, so the loop would re-request the same chunk. I am not claiming this happens today — no shipped implementation can populate the field. This is an interface-hygiene report, not a livelock report.
Environment
Static analysis of main at 82ab4d3c, cross-checked against bsv-blockchain/go-wallet-toolbox.
Area
Wallet
Affected package or service and version
@bsv/wallet-toolbox—src/sdk/WalletStorage.interfaces.ts:718,src/storage/WalletStorageManager.ts. Current onmainat82ab4d3c.Defect
ProcessSyncChunkResultdeclares anerrormember:No consumer reads it and no producer sets it:
WalletStorageManager(syncToWriter,syncFromReader) consumer.inserts,r.updates,r.doneandr.nextCheckpoint. Occurrences ofr.errorin that file: 0.EntitySyncState.processSyncChunk's declared return type is{ done, maxUpdated_at, updates, inserts }— noerrormember at all — andStorageProvider.processSyncChunkreturns that plusnextCheckpoint. So the local path cannot populate it.StorageClientBase.processSyncChunkdeserializes whatever the server returned into the same interface, but the server calls the sameStorageProvidermethod, so it cannot populate it either.go-wallet-toolbox'sProcessSyncChunkResultstruct isDone / MaxUpdatedAt / Updates / Insertswith noErrorfield; Go propagates failures through its ordinaryerrorreturn.So the field is declared in one implementation, absent in the other, never set by either, and read by nobody.
Minimal reproduction
Static:
grep -c "r\.error" src/storage/WalletStorageManager.ts→0, whileerror?: WalletErroris declared on the interface.Expected behavior
Either remove the field, or specify who sets it and have both loops act on it. As written it is a declared failure channel that silently does nothing.
Actual behavior and evidence
A third-party writer implementing this interface could reasonably populate
errorto report a non-throwing failure, and both loops would ignore it: neither setsdone, so the loop would re-request the same chunk. I am not claiming this happens today — no shipped implementation can populate the field. This is an interface-hygiene report, not a livelock report.Environment
Static analysis of
mainat82ab4d3c, cross-checked againstbsv-blockchain/go-wallet-toolbox.