Skip to content

WCI-2309 fix(sdk-core): opt rotation walk into slim key list - #10197

Open
vibhavgo wants to merge 1 commit into
masterfrom
WCI-2309-sdk-slim-rotation-fetch
Open

vibhavgo wants to merge 1 commit into
masterfrom
WCI-2309-sdk-slim-rotation-fetch

Conversation

@vibhavgo

Copy link
Copy Markdown
Contributor

Ticket

WCI-2309 (incident WCN-4788) — Optimize changePassword key fetching (client side)

Summary

Opts the legacy keychains().updatePassword rotation walk (login-password sync) into the server's new envelopeOnly=true slim key list (server PR: BitGo/bitgo-microservices#64575), and pipelines the walk: the next page's fetch starts as soon as the current page arrives, so page N+1's network round-trip overlaps page N's re-encryption (~2 s/page of client crypto hidden behind the fetch).

  • Keychains.list() gains an optional envelopeOnly?: boolean, validated and forwarded the same way as limit/prevId/safeId; false/undefined produce a query identical to today's.
  • The walk passes envelopeOnly: true on every page and consumes the slim shape (id, pub, type, source, caller's encryptedPrv, coinSpecific.ofc.features) — a superset of nothing it needs: tss/ofc multi-user keys are keyed by id, plain keys by pub, and updateSingleKeychainPassword touches only encryptedPrv.
  • No breaking change: envelopeOnly is optional; old servers ignore the unknown query param and return full keychains, and the walk handles full responses unchanged (covered by test). Deploy the server PR first for the latency win; shipping the SDK alone is behavior-neutral.
  • Progress events are unchanged: page N's records are all processed (and reported) before page N+1's, so per-record event order stays deterministic; the in-flight prefetch attaches a no-op catch so a rejected fetch can never become an unhandled rejection.
  • Safe-mode rotation (safeId present) is untouched.

Test plan

  • modules/sdk-core/test/unit/bitgo/keychain/keychains.ts: 32/32 passing — new coverage for param forwarding/rejection, slim-response rotation, prefetch-before-processing ordering, old-server full-response fallback, and identifier mapping (tss/ofc multi-user → id, plain → pub).
  • modules/sdk-api/test/unit/bitgoApi.ts: 79 passing (changePassword suites stub updatePassword above this layer; unchanged).
  • npx tsc --build clean for sdk-core and sdk-api; eslint clean on touched files.

@linear-code

linear-code Bot commented Nov 18, 2026

Copy link
Copy Markdown
Contributor

WCI-2309

@github-actions

github-actions Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

⚠️ Compatibility checks are failing on Node.js 27-nightly (experimental, non-blocking). This does not block merge, but it signals an incompatibility to fix before this release becomes supported.

View run

Keychains.list() gains an optional envelopeOnly flag forwarded as the
`envelopeOnly=true` query param; the legacy updatePassword walk opts in
and pipelines the next page's fetch while the current page re-encrypts
(shaving ~2s/page of client crypto off the serial round-trip). Progress
event ordering and per-record outcomes are unchanged; old servers
ignoring the param keep today's behavior. Safe-mode rotation is
untouched.

Ticket: WCI-2309
@vibhavgo
vibhavgo force-pushed the WCI-2309-sdk-slim-rotation-fetch branch from f42c9be to 19d1f5a Compare November 18, 2026 10:49
@vibhavgo
vibhavgo marked this pull request as ready for review November 18, 2026 11:06
@vibhavgo
vibhavgo requested review from a team as code owners November 18, 2026 11:06

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Claude Code Review

This repository is configured for manual code reviews. Comment @claude review for a one-time review, or @claude review always to subscribe this PR to a review on every future push.

Tip: disable this comment in your organization's Code Review settings.

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.

1 participant