-
Notifications
You must be signed in to change notification settings - Fork 619
[SDK] Rename otherWallets to allConnectedWallets in onConnect callback #8407
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[SDK] Rename otherWallets to allConnectedWallets in onConnect callback #8407
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
WalkthroughThe Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~5–10 minutes
Pre-merge checks and finishing touches❌ Failed checks (1 inconclusive)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro Disabled knowledge base sources:
📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
Warning Review ran into problems🔥 ProblemsErrors were encountered while retrieving linked issues. Errors (1)
Comment |
How to use the Graphite Merge QueueAdd either label to this PR to merge it via the merge queue:
You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. This stack of pull requests is managed by Graphite. Learn more about stacking. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Disabled knowledge base sources:
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (1)
packages/thirdweb/src/wallets/connection/types.ts(1 hunks)
🧰 Additional context used
📓 Path-based instructions (3)
**/*.{ts,tsx}
📄 CodeRabbit inference engine (CLAUDE.md)
**/*.{ts,tsx}: Write idiomatic TypeScript with explicit function declarations and return types
Limit each file to one stateless, single-responsibility function for clarity
Re-use shared types from@/typesor localtypes.tsbarrels
Prefer type aliases over interface except for nominal shapes
Avoidanyandunknownunless unavoidable; narrow generics when possible
Choose composition over inheritance; leverage utility types (Partial,Pick, etc.)
Comment only ambiguous logic; avoid restating TypeScript in prose
Files:
packages/thirdweb/src/wallets/connection/types.ts
**/*.{ts,tsx,js,jsx}
📄 CodeRabbit inference engine (CLAUDE.md)
Load heavy dependencies inside async paths to keep initial bundle lean (lazy loading)
Files:
packages/thirdweb/src/wallets/connection/types.ts
packages/thirdweb/src/wallets/**
📄 CodeRabbit inference engine (CLAUDE.md)
packages/thirdweb/src/wallets/**: UnifiedWalletandAccountinterfaces in wallet architecture
Support for in-app wallets (social/email login)
Smart wallets with account abstraction
EIP-1193, EIP-5792, EIP-7702 standard support in wallet modules
Files:
packages/thirdweb/src/wallets/connection/types.ts
🧠 Learnings (2)
📚 Learning: 2025-07-18T19:19:55.613Z
Learnt from: CR
Repo: thirdweb-dev/js PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Applies to packages/thirdweb/src/wallets/** : Unified `Wallet` and `Account` interfaces in wallet architecture
Applied to files:
packages/thirdweb/src/wallets/connection/types.ts
📚 Learning: 2025-07-18T19:19:55.613Z
Learnt from: CR
Repo: thirdweb-dev/js PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Applies to packages/thirdweb/src/wallets/** : EIP-1193, EIP-5792, EIP-7702 standard support in wallet modules
Applied to files:
packages/thirdweb/src/wallets/connection/types.ts
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (8)
- GitHub Check: E2E Tests (pnpm, webpack)
- GitHub Check: Lint Packages
- GitHub Check: E2E Tests (pnpm, vite)
- GitHub Check: Unit Tests
- GitHub Check: E2E Tests (pnpm, esbuild)
- GitHub Check: Build Packages
- GitHub Check: Size
- GitHub Check: Analyze (javascript)
| * onConnect={(activeWallet, allConnectedWallets) => { | ||
| * console.log("auto connected to", activeWallet) | ||
| * console.log("other wallets that were also connected", otherWallets) | ||
| * console.log("all connected wallets", allConnectedWallets) | ||
| * }} | ||
| * /> | ||
| * ``` | ||
| */ | ||
| onConnect?: (activeWallet: Wallet, otherWallets: Wallet[]) => void; | ||
| onConnect?: (activeWallet: Wallet, allConnectedWallets: Wallet[]) => void; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
Verify semantic accuracy and breaking change impact.
This rename from otherWallets to allConnectedWallets is a breaking change for TypeScript users. The new name implies the array contains ALL connected wallets, but it's unclear whether this includes the activeWallet or only the other wallets (excluding the active one).
Please clarify:
- Does
allConnectedWalletsinclude theactiveWalletparameter, or does it contain only the other connected wallets (excluding the active one)? - If it includes the active wallet, consider adding a JSDoc comment to clarify this behavior.
- Ensure all call sites across the codebase have been updated to use the new parameter name.
🏁 Script executed:
#!/bin/bash
# Verify all references to the old parameter name have been updated
# Search for any remaining references to 'otherWallets' in the context of onConnect
rg -n --type ts --type tsx -C 3 'otherWallets'
# Search for all implementations/call sites of the onConnect callback
ast-grep --pattern $'onConnect: ($_, $_) => {
$$$
}'
# Search for all usages of AutoConnectProps to ensure consistency
rg -n --type ts --type tsx -C 3 'AutoConnectProps'Length of output: 55
🏁 Script executed:
#!/bin/bash
# Verify all references to the old parameter name have been updated
# Using glob patterns instead of --type flags
# Search for any remaining references to 'otherWallets'
rg -n -C 3 'otherWallets' -g '*.ts' -g '*.tsx'
# Search for onConnect callback usages and implementations
rg -n -C 5 'onConnect' -g '*.ts' -g '*.tsx' | head -100
# Search for AutoConnectProps usages
rg -n -C 3 'AutoConnectProps' -g '*.ts' -g '*.tsx'Length of output: 21928
🏁 Script executed:
#!/bin/bash
# Find where onConnect callback is actually invoked in autoConnectCore.ts
rg -n -C 10 'props.onConnect' -g '*.ts' -g '*.tsx' | head -200Length of output: 20554
🏁 Script executed:
#!/bin/bash
# Search for onConnect callback invocation specifically in autoConnectCore.ts
# Look for where the callback is actually called
rg -n 'manager\.onConnect\|props\.onConnect' packages/thirdweb/src/wallets/connection/autoConnectCore.ts -C 15
# Also check the manager onConnect method definition
rg -n 'onConnect' packages/thirdweb/src/wallets/manager/index.ts -C 5Length of output: 1262
🏁 Script executed:
#!/bin/bash
# Find where onConnect callback is actually invoked in autoConnectCore.ts
rg -n -A 5 -B 5 'handleWalletConnection' packages/thirdweb/src/wallets/connection/autoConnectCore.ts | head -80
# Also check the handleWalletConnection function signature
rg -n -A 10 'const handleWalletConnection' packages/thirdweb/src/wallets/connection/autoConnectCore.tsLength of output: 1119
Update variable naming in autoConnectCore.ts to match new parameter semantics.
The type definition parameter was renamed from otherWallets to allConnectedWallets, but the internal variable in autoConnectCore.ts (line 172) is still named otherWallets. While the actual callback receives the correct data (all connected wallets) through manager.connect(), this naming mismatch creates confusion.
Rename otherWallets to better reflect that it contains wallets other than the active one being connected, or document why this distinction is maintained internally. The parameter name change to allConnectedWallets should be consistently reflected throughout the codebase for clarity.
🤖 Prompt for AI Agents
In packages/thirdweb/src/wallets/connection/autoConnectCore.ts around line 172,
rename the internal variable currently named otherWallets to allConnectedWallets
(or another clearer name like otherConnectedWallets if you want to emphasize
"other than active") and update every reference/usage in that file so it matches
the onConnect type signature in types.ts; ensure the value passed into the
onConnect callback and any local documentation/comments reflect the new name to
avoid confusion.
size-limit report 📦
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #8407 +/- ##
==========================================
- Coverage 54.83% 54.82% -0.01%
==========================================
Files 919 919
Lines 60844 60844
Branches 4135 4136 +1
==========================================
- Hits 33364 33359 -5
- Misses 27379 27383 +4
- Partials 101 102 +1
🚀 New features to boost your workflow:
|
Merge activity
|
#8407) <!-- ## title your PR with this format: "[SDK/Dashboard/Portal] Feature/Fix: Concise title for the changes" If you did not copy the branch name from Linear, paste the issue tag here (format is TEAM-0000): ## Notes for the reviewer Anything important to call out? Be sure to also clarify these in your comments. ## How to test Unit tests, playground, etc. --> <!-- start pr-codex --> --- ## PR-Codex overview This PR focuses on updating the `onConnect` callback in the `AutoConnect` component to improve clarity in variable naming, changing `otherWallets` to `allConnectedWallets`. ### Detailed summary - Changed the parameter name in `onConnect` from `otherWallets` to `allConnectedWallets`. - Updated the console log statement to reflect the new parameter name, changing it from "other wallets that were also connected" to "all connected wallets". > ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}` <!-- end pr-codex --> <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Breaking Changes** * Updated parameter naming in the AutoConnect callback configuration to align with updated documentation. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
f818d2b to
9442dc7
Compare

PR-Codex overview
This PR updates the
onConnectcallback in theAutoConnectcomponent to improve clarity in the variable names, changingotherWalletstoallConnectedWalletsand updating the corresponding console log message.Detailed summary
onConnectfromotherWalletstoallConnectedWallets.Summary by CodeRabbit