Skip to content

fix(wallet-toolbox): wire live-sync chain preflight and ProcessSyncChunkResult.error - #551

Draft
sirdeggen wants to merge 6 commits into
mainfrom
cursor/wallet-toolbox-dead-code-541-542-884b
Draft

sirdeggen wants to merge 6 commits into
mainfrom
cursor/wallet-toolbox-dead-code-541-542-884b

Conversation

@sirdeggen

@sirdeggen sirdeggen commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

Addresses #541 and #542 by wiring the existing public surfaces. This is not an API deletion.

Reworked after maintainer review (CHANGES_REQUESTED): WERR_NETWORK_CHAIN and ProcessSyncChunkResult.error stay public. Live syncToWriter / syncFromReader now compare reader and writer TableSettings.chain before any chunk moves and throw WERR_NETWORK_CHAIN on mismatch. Custom writers may set ProcessSyncChunkResult.error; both live-sync loops throw that error and stop. First-party providers still throw. Deserializer and instanceof JSON round-trip coverage remain.

Merged onto current origin/main including #1029 (6493d5f29). Conflicts were changelog and release notes only; live-sync source did not conflict. Unpublished candidate remains 2.14.7.

Program and scope

Impact

  • No public package source or manifest changed
  • Public package source or manifest changed; affected packages are listed below
  • Infrastructure source, dependency, image, or deployment configuration changed
  • Public API, exports, types, runtime targets, or browser/mobile behavior changed
  • Security-sensitive boundary changed
  • Documentation or examples changed

Affected packages/services and intended patch versions (publication occurs only
through the release workflow after approval):

  • @bsv/wallet-toolbox 2.14.7 (unpublished candidate vs published 2.14.5; releaseType remains patch; no version bump)
  • @bsv/wallet-toolbox-client and @bsv/wallet-toolbox-mobile share the same source

Verification

  • Local commands and results after this merge:
    • pnpm --filter @bsv/wallet-toolbox exec jest --testPathPatterns='WalletError.test|liveSyncGuards.test|liveSyncManager.test' --no-coverage — 3 suites, 35 passed
    • pnpm docs:packages:check — passed
    • pnpm health:check — passed (existing maintenance reminders only)
  • Hosted CI run: https://github.com/bsv-blockchain/ts-stack/actions/runs/38276831958 on exact head e9280ff14157f038f584d2a362409006a86c5561. 39 successful checks including Build, lint, and policy, build-and-test (24.x), wallet-toolbox coverage, packed-consumer, browser/mobile, Mutation quality, and merge-gate. Expected skips only.
  • Conformance evidence: hosted Conformance Vectors and ts-runner succeeded
  • Coverage delta: hosted wallet-toolbox coverage succeeded
  • Lint/typecheck delta: hosted CI / Build, lint, and policy succeeded
  • Browser/mobile/packed-consumer evidence: hosted wallet browser, wallet mobile, browser packages, and package-artifacts succeeded
  • Performance or bundle-size delta: none expected
  • I self-reviewed the complete diff for correctness, security,
    compatibility, public API, artifacts, dependencies, docs, and operations
  • All applicable checks are terminal and successful on the exact head; any
    scope-based skip is expected and validated by the merge gate

Security and dependencies

  • No dependency or lockfile change relative to current main
  • Changelog, runtime relevance, peer compatibility, transitive graph, and
    audit results were reviewed
  • CodeQL/negative tests cover any changed trust boundary
  • The exact-head CodeQL analysis has no new alert
  • The exact-head repository quality gate reports zero new Sonar findings
    (including accepted or false-positive issue states) and zero unreviewed hotspots;
    Sonar's aggregate Quality Gate passed verdict alone is not merge evidence
  • No new override, advisory dismissal, quality suppression, or skipped test
  • Any temporary exception is registered with owner, evidence, review date,
    and removal condition
  • Workflow permissions and lifecycle-script behavior remain least privilege

Release and operations

  • No npm publication was performed from a workstation or from this PR
  • Required npm patch bumps are included or intentionally deferred by the
    controlling program
  • Image/SBOM/provenance/deployment/rollback impact is documented (none)
  • Documentation, changelog, migration, and operational guidance are current

Decision

Public surfaces are retained and wired. Hosted CI is green on this merge head. Keep as draft for maintainer re-review (prior CHANGES_REQUESTED still stands). Do not merge.

Open in Web Open in Cursor 

@codecov

codecov Bot commented Sep 21, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@ty-everett ty-everett left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maintainer review: retain this as draft and redesign it compatibly. WERR_NETWORK_CHAIN is exported through the public sdk namespace and SDK subpath; removing it breaks consumer imports, instanceof checks and typed JSON round trips. ProcessSyncChunkResult.error is also a public declaration. Internal non-use and the artifact checker’s selected export list do not establish absence of external consumers. Keep/deprecate these surfaces, retain round-trip coverage, and address #541 with an explicit live-sync chain preflight and #542 with documented, tested custom-provider failure handling. Do not close those issues through an API deletion in this maintenance release. A deliberate removal would need an approved major-version migration. Current main has also advanced substantially, so final acceptance must be rerun after the compatible revision.

…ChunkResult.error

WERR_NETWORK_CHAIN was defined and deserialized but never thrown, and no
processSyncChunk producer or consumer set or read result.error. Remove the
dead surface instead of inventing new chain-mismatch or chunk-error
semantics. Historical JSON with that error name still deserializes as a
generic WalletError.

Closes #541
Closes #542

Co-authored-by: deggen <d.kellenschwiler@bsvassociation.org>
@cursor
cursor Bot force-pushed the cursor/wallet-toolbox-dead-code-541-542-884b branch from fbb0b5f to 5616c96 Compare October 9, 2026 12:01
cursoragent and others added 2 commits October 9, 2026 12:05
…0-16

The 2026-10-08 reviewBy date expired on main and blocks hosted CI. Static
re-review confirms the same 30 dispositions; 29 source hashes are unchanged
and the remaining suite matches the 2026-10-05 hash. No suite was executed.

Co-authored-by: deggen <d.kellenschwiler@bsvassociation.org>
…unkResult.error

Keep WERR_NETWORK_CHAIN and ProcessSyncChunkResult.error as public surfaces.
Compare reader/writer TableSettings.chain before any live-sync chunk moves and
throw WERR_NETWORK_CHAIN on mismatch. Honor a custom writer's
ProcessSyncChunkResult.error by throwing it and stopping the loop. First-party
providers still throw. Addresses #541 and #542 without an API deletion.

Co-authored-by: deggen <d.kellenschwiler@bsvassociation.org>
@cursor cursor Bot changed the title fix(wallet-toolbox): remove unused WERR_NETWORK_CHAIN and ProcessSyncChunkResult.error fix(wallet-toolbox): wire live-sync chain preflight and ProcessSyncChunkResult.error Oct 9, 2026
cursoragent and others added 3 commits October 9, 2026 14:32
Close GHSA-8r5x-fm3f-whwj and GHSA-p8wg-vrv2-v86f on the frozen
ts-jest graph. 4.7.10 is younger than the 7-day floor until 2026-10-12,
so handlebars is temporarily age-excluded for this security install.

Co-authored-by: deggen <d.kellenschwiler@bsvassociation.org>
Resolve conflicts with #968 and the 2.14.7 wallet-toolbox train. Keep the
compatible live-sync wiring. Drop the temporary handlebars override now
that main already locks 4.7.10 and treats release age as advisory.

Co-authored-by: deggen <d.kellenschwiler@bsvassociation.org>
Bring in #1029 (IndexedDB confirmed internalize). Conflicts were changelog
and release notes only; keep both 2.14.7 notes and the live-sync wiring.

Co-authored-by: deggen <d.kellenschwiler@bsvassociation.org>
@sonarqubecloud

Copy link
Copy Markdown

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants