Migrate CLI to product-sdk#148
Open
charlesHetterich wants to merge 8 commits intomainfrom
Open
Conversation
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
Contributor
|
Dev build ready — try this branch: |
Contributor
E2E Test Pass · ❌ FAILTag:
Sentry traces: view spans for this run |
1d9f7ef to
0b5960c
Compare
…dProof The published @parity/product-sdk-terminal@0.1.0 funnels every signing op through session.signRaw, which the mobile wallet wraps with <Bytes>...</Bytes> (anti-phishing envelope, see polkadot-app-android-v2's MessageSigningContext.kt::generalUntrustedMessage). For tx payloads that produces a signature the chain rejects as BadProof. Mirror the upstream fix (paritytech/product-sdk a33edf3) locally in auth.ts: build a PJS signer with split callbacks — tx via session.signPayload (no envelope), bytes via session.signRaw (envelope correct for free-form data). Drop back to createSessionSignerForAccount once the upstream fix ships on npm. Also: pin @parity/product-sdk-* to exact versions (pre-1.0 SDK; carets let patch bumps silently flip wire shape), bump changeset to minor (the PR is a runtime SDK swap), refresh CLAUDE.md and README.md to reflect the product-sdk surface and the still-load-bearing <Bytes> invariant.
…, tests - AGENTS.md: refresh dependency rules (drop stale @polkadot-apps/chain-client reference, document the @dotdm/contracts/PAPI-1.x blocker), update the metadata-upload rule to point at calculateCid + direct PAPI submit, and add a Runtime Safety entry for the still-load-bearing <Bytes> mobile-wrap invariant + the createPlaygroundSigner workaround. - tools/list-registry-apps.ts: drop the inline fetchJsonFromGateway (own goal in commit ac4aaaa) and reuse src/utils/bulletinGateway.ts, which reads the gateway URL from getChainConfig() instead of hardcoding paseo. - src/utils/auth.ts: mark makeSignPayloadCallback / makeSignRawCallback @internal, mirroring the existing clearLocalAppStorage convention so the test seams aren't mistaken for a public API. - src/utils/bulletinGateway.test.ts: cover URL composition, 2xx/non-2xx paths, abort-on-timeout, and JSON parsing — 8 new tests, all passing.
… logout
@parity/product-sdk-terminal@0.1.0::destroy() tears down the underlying
polkadot-api client without awaiting in-flight statement-subscription
unsubscribes. PAPI's raw-client disconnect() then errors every pending
request with `new DestroyedError("Client destroyed")`
(@polkadot-api/raw-client/dist/esm/createClient.mjs:58 —
`responses.forEach((r) => r.onError(new DestroyedError()))`), which
surfaces as an unhandled promise rejection right above our "✓ signed
out" line.
The error is benign: the actual logout already succeeded, this fires
purely as a teardown-race artifact. DestroyedError is exclusive to
PAPI's raw-client teardown path (only `disconnect()` constructs and
throws this class), so matching the bare error name in our existing
benign-unsubscription filter is safe.
Same family as the UnsubscriptionError / Not connected and DisjointError
shapes we already suppress for `dot deploy`. Real upstream fix is for
product-sdk-terminal's destroy() to drain statement-subscription
teardowns before disconnecting the lazy client; tracking that
separately.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
closes #144
closes #145
Summary
@polkadot-apps/*dependencies/imports to@parity/product-sdk-*playground.dotwhile preserving thedot-clisession namespaceVerification
pnpm installnpx tsc --noEmitpnpm testpnpm format:checkpnpm buildpnpm cli:installbun run src/index.ts deploy --helpbun run src/index.ts logout --helpbun run src/index.ts init --help~/.polkadot/bin/dot --helpNotes
pnpm-lock.yamlstill contains transitive@polkadot-apps/*entries through@dotdm/contracts@1.0.1; direct app/runtime imports are migrated.