feat: event improvements#466
Conversation
|
| Name | Type |
|---|---|
| @reown/appkit-core-react-native | Patch |
| @reown/appkit-react-native | Patch |
| @reown/appkit-ui-react-native | Patch |
| @reown/appkit-common-react-native | Patch |
| @reown/appkit-ethers-react-native | Patch |
| @reown/appkit-solana-react-native | Patch |
| @reown/appkit-bitcoin-react-native | Patch |
| @reown/appkit-wagmi-react-native | Patch |
| @reown/appkit-coinbase-react-native | Patch |
Click here to learn what changesets are, and how to add one.
Click here if you're a maintainer who wants to add a changeset to this PR
|
Claude finished @ignaciosantise's task —— View job ✅ Code Review CompleteThis pull request introduces comprehensive event tracking improvements and type safety enhancements. Here's my detailed analysis: Major Findings🔒 Security Issues
🚨 Critical Code Quality Issues
⚡ Performance Concerns
📋 Type Safety & Best Practices
🔧 Minor Issues
RecommendationsImmediate Actions Required:
Suggested Improvements:
Overall AssessmentThis is a solid enhancement to event tracking and type safety. The code quality is generally good with proper error handling and TypeScript usage. However, the security concerns around data exposure in analytics events need immediate attention before merging. Recommendation: Address security issues and add changeset before approval. |
|
There was a problem hiding this comment.
Bug: Memoization Ignores Index, Causing Analytics Issues
The MemoizedWalletItem's memo comparison only checks item.id, but the component now receives a displayIndex prop. This prevents re-renders when displayIndex changes, which can lead to stale displayIndex values being passed to onItemPress and inaccurate analytics.



Summary
This pull request introduces several improvements and enhancements to event tracking, type safety, and wallet list handling in the AppKit package. The changes focus on providing richer analytics data, improving type consistency for network and namespace identifiers, and passing additional context when interacting with wallet items.
Event Tracking Enhancements:
namespace,caipNetworkId,walletRank,displayIndex, and walletnameacross various connection, disconnection, and wallet selection flows. This provides more granular insights into user actions and wallet interactions. [1] [2] [3] [4] [5] [6] [7] [8]Type Safety and Consistency:
disconnectmethod and related hooks to use theChainNamespacetype instead of a plain string, ensuring better type safety and consistency when specifying namespaces. [1] [2] [3]caipNetworkIdrather than ambiguous or fallback string values. [1] [2] [3] [4] [5]Wallet List and Selection Improvements:
WalletItem,WalletList, and related props) to pass and handle adisplayIndexandwalletRank, providing more context for analytics and improving the ability to track user selection behavior. [1] [2] [3] [4] [5] [6] [7] [8] [9]Initialization and Controller Improvements:
These changes collectively enhance the observability, reliability, and maintainability of the AppKit package, particularly in how user actions and wallet interactions are tracked and handled.
Note
Expands analytics events (including initialize, reconnect, and detailed wallet selection), standardizes
caipNetworkIdandChainNamespaceusage, passes wallet display index/rank, and improves connector init and error logging.INITIALIZEand richerCONNECT_SUCCESS/DISCONNECT_SUCCESSpayloads (e.g.,namespace,address,caipNetworkId,reconnect).explorerId(notexplorer_id), optional network fields typed asCaipNetworkId.GET_WALLET,CLICK_GET_WALLET_HELP, and addwalletRank,displayIndex,viewonSELECT_WALLET.CONNECT_SUCCESSafter session restore; includeSWITCH_NETWORKnetworkascaipNetworkId.ChainNamespacefordisconnect; update hook signature.caipNetworkId(remove empty-string fallbacks); update SIWX and send/swap event typings.polkadotfromChainNamespace; alignNATIVE_TOKEN_ADDRESS.displayIndexthroughWalletList/WalletItemand selection handlers; includewalletRankin analytics.INITIALIZEevent with config (theme, networks, features, adapters, etc.).LogController.sendErrorto handle error-like objects; improve cancel detection in send flow.Written by Cursor Bugbot for commit b8cf55d. This will update automatically on new commits. Configure here.