Skip to content

feat(chat-app): migrate to @mysten/dapp-kit-react#74

Open
ioannischtz wants to merge 9 commits into
mainfrom
sew-1003-chat-app-migrate-mystendapp-kit-mystendapp-kit-react
Open

feat(chat-app): migrate to @mysten/dapp-kit-react#74
ioannischtz wants to merge 9 commits into
mainfrom
sew-1003-chat-app-migrate-mystendapp-kit-mystendapp-kit-react

Conversation

@ioannischtz

Copy link
Copy Markdown
Collaborator

Migrates the chat-app off the deprecated @mysten/dapp-kit (JSON-RPC-only) to @mysten/dapp-kit-react + @mysten/dapp-kit-core (gRPC-native). Closes SEW-1003.

  • createDAppKit + DAppKitProvider replace the three-provider stack; removed hooks swapped for useCurrentClient / useDAppKit imperative methods; @mysten/sui bumped to ^2.17.0 (peer requirement); unused TanStack Query dropped.
  • New signAndExecute helper: throws on the $kind: 'FailedTransaction' result union (the new kit doesn't throw) and waits for tx indexing before resolving, so call sites get read-your-writes ordering.
  • Dev-wallet registration goes through devWalletInitializer({ mountUI: true }) in walletInitializers — drops the manual DevWallet + register() + mountDevWallet() shim from feat(chat-app): fully-local devstack stack with local Seal #73; panel pinned to localnet via onWalletCreated.
  • Session keys move to Tier 1: QueuedCurrentAccountSigner subclasses dapp-kit-core's CurrentAccountSigner and serializes signPersonalMessage (dApp Kit doesn't queue wallet requests; the dev-wallet rejects concurrent signs). Hand-rolled DappKitSigner deleted.
  • Fixes surfaced in manual review: ErrorBoundary crash during the autoConnect-restore window on reload; "no permission" banner right after group creation.
  • Docs: chat-app README / DEVSTACK / SYSTEM_DESIGN, devstack + session-key skills, and SDK doc examples migrated off the deprecated kit.

Verified: devstack localnet create → send → fresh-session decrypt (Playwright-driven, incl. dev-wallet approvals); testnet create → send → fresh-client decrypt over the same gRPC client config; browser gRPC-Web CORS probe against the testnet fullnode.

Done via Fable 5 + dynamic-workflows + manual steering.

🤖 Generated with Claude Code

ioannischtz and others added 8 commits June 12, 2026 12:19
- Replace deprecated @mysten/dapp-kit (JSON-RPC) with @mysten/dapp-kit-react +
  @mysten/dapp-kit-core (gRPC-native); bump @mysten/sui to ^2.17.0 and drop the
  now-unused @tanstack/react-query.
- New src/lib/dapp-kit.ts: createDAppKit instance (testnet + devstack localnet
  networks, SuiGrpcClient factory) and a signAndExecute helper that throws on
  FailedTransaction, since the new kit returns a $kind union instead of throwing.
- Swap the provider stack to DAppKitProvider and the removed hooks to their
  replacements (useCurrentClient, useDAppKit, imperative sign methods); delete
  network-config.ts.
- Register the devstack dev-wallet through devWalletInitializer /
  walletInitializers instead of the manual DevWallet + register + mountDevWallet
  shim, pinning the panel's active network to localnet.
- Keep the queued-sign serialization: dApp Kit does not queue wallet requests
  and the dev-wallet rejects concurrent signs.

Verified on devstack localnet (connect, create group, send, fresh-session
decrypt via Playwright) and on testnet (create, send, fresh-client decrypt over
the same gRPC client config, plus browser gRPC-Web CORS probe).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- README: new package names, dependency table, gRPC endpoint note for
  VITE_SUI_RPC_URL.
- DEVSTACK.md: shim now hands a walletInitializers entry to createDAppKit;
  drop the completed migration follow-up note.
- SYSTEM_DESIGN.md: provider stack, client-init flow, and session-key ADR
  updated to the createDAppKit/DAppKitProvider architecture.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- spin-up-local-devstack: dev-wallet wiring now goes through
  devWalletInitializer / walletInitializers; refresh the mountDevWallet
  troubleshooting entries and mark the migration follow-up done.
- configure-session-keys / integrate-sui-stack-messaging: fix stale
  dapp-kit-next / CurrentAccountSigner package references.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- Replace the hand-rolled DappKitSigner + onSign callback with dApp Kit's
  CurrentAccountSigner, subclassed as QueuedCurrentAccountSigner to serialize
  personal-message signs (dApp Kit doesn't queue wallet requests; the devstack
  dev-wallet rejects concurrent signs).
- Switch the SDK session-key config from Tier 2 (address + onSign) to Tier 1
  ({ signer }) — Seal certifies the session key through the queued signer, so
  the ceremony and relayer request signing share one queue.
- Drop the queuedSign promise-chain plumbing from MessagingClientContext.

Verified on devstack localnet (send + fresh-session decrypt) and testnet
(Tier-1 create -> send -> fresh-client decrypt, digest 32fGQrMpszmSHVM9...).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- chat-app README / DEVSTACK / SYSTEM_DESIGN: Tier-1 signer-based session keys,
  queued-signer file map entry, ADR-2 rewritten for the queued
  CurrentAccountSigner decision.
- Skills: point the sign-serialization guidance at the queued-signer pattern
  and the worked example in chat-app/src/lib/queued-signer.ts.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- Examples.md: tx.* wallet integration now uses useDAppKit() +
  signAndExecuteTransaction, with a note on the $kind result union.
- Setup.md / Encryption.md: CurrentAccountSigner is @mysten/dapp-kit-core's
  (was attributed to dapp-kit / dapp-kit-next).
- APIRef.md / Setup.md: neutral "dApp Kit" wording for tx.* signing.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
After a reload, dApp Kit's autoConnect restores the account before the
messaging client finishes initializing (in devstack mode it waits on the
generated-config load). CreateGroupModal mounted on `account` alone and calls
useRequiredMessagingClient before its `open` check, so the init window threw
"Wallet must be connected to use messaging client" into the ErrorBoundary —
unrecoverable across reloads since the race reproduces every time.

Render the body and modal only once the client exists, with an interim
"Setting up the messaging client" state while an account is connected.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Callers read back the state they just changed (permissions after group
creation, member lists after admin actions), but fullnode reads lag execution
until the transaction is indexed. The most visible symptom: right after
creating a group, the auto-selected chat showed "You don't have permission to
send messages" until the group was re-selected.

Wait on dAppKit.getClient().waitForTransaction(digest) before resolving, so
every call site gets read-your-writes ordering.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@vercel

vercel Bot commented Jun 12, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
groups-sdk Ready Ready Preview, Comment Jun 16, 2026 2:43pm

Request Review

Comment thread chat-app/vite.config.ts Outdated
@jessiemongeon1

Copy link
Copy Markdown
Collaborator

Style Guide Audit

Audited 4 file(s) against the Sui Documentation Style Guide.

2 violation(s) found. All must be fixed before merge.

docs/sui-stack-messaging/Examples.md (2 violation(s))

2 violation(s) (2 regex, 0 claude)

  • Line 204 — No em dashes in prose
    • Current:
    • Fix: Rewrite with comma, parentheses, or split sentence
  • Line 204 — "on-chain" is one word → "onchain"
    • Current: on-chain
    • Fix: onchain

Automated audit using the Sui Documentation Style Guide.

- Examples.md: remove em dash and use "onchain" per the Sui docs style guide.
- vite.config.ts: fix an inaccurate comment — devstackVitePlugin() aliases
  @generated only; the dev wallet is registered via the shim's
  walletInitializers entry (SHIM_ACTIVE_SOURCE), not the plugin.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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