-
Notifications
You must be signed in to change notification settings - Fork 7
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
fix: Wallet Connect #1294
fix: Wallet Connect #1294
Conversation
Removed Second Signature Handling Removed check for isOnXmtp network Removed unused translations
Warning Rate limit exceeded@alexrisch has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 5 minutes and 18 seconds before requesting another review. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. WalkthroughThe changes in this pull request primarily involve the removal of the Changes
Possibly related PRs
Suggested labels
Suggested reviewers
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
Performance Comparison ReportSignificant Changes To DurationThere are no entries Meaningless Changes To DurationShow entries
Show details
Render Count ChangesThere are no entries Render IssuesThere are no entries Added ScenariosThere are no entries Removed ScenariosThere are no entries |
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: 0
🧹 Outside diff range and nitpick comments (4)
components/Onboarding/ConnectViaWallet/useInitConnectViaWalletState.ts (1)
95-96
: Consider adding debug logging for initialization stepsThe logging message could be more detailed to help with debugging. Consider adding intermediate logs for key initialization steps.
- `[Connect Wallet] User connected wallet ${thirdwebWallet?.id} (${address}). V3 database ${hasV3 ? "already" : "not"} present` + `[Connect Wallet] User connected wallet ${thirdwebWallet?.id} (${address}). Status: V3 database ${hasV3 ? "already" : "not"} present, Inbox ID retrieved successfully`components/Onboarding/ConnectViaWallet/ConnectViaWallet.tsx (3)
156-164
: Simplify conditional logic furtherThe current if-else structure can be simplified as it's checking mutually exclusive conditions.
- if (!alreadyV3Db) { - title = translate("connectViaWallet.sign"); - subtitle = translate("connectViaWallet.firstSignature.explanation"); - } - else if (alreadyV3Db) { - title = translate("connectViaWallet.firstSignature.title"); - subtitle = translate("connectViaWallet.firstSignature.explanation"); - } + title = alreadyV3Db + ? translate("connectViaWallet.firstSignature.title") + : translate("connectViaWallet.sign"); + subtitle = translate("connectViaWallet.firstSignature.explanation");
Line range hint
126-139
: Review primaryButtonAction logicThe primaryButtonAction still contains logic for waitingForNextSignature but the second signature handling has been removed. This appears to be inconsistent with the PR objectives.
- const primaryButtonAction = useCallback(() => { - if (waitingForNextSignature) { - logger.debug("[Connect Wallet] User clicked on second sign button"); - connectViewWalletStore.getState().setLoading(true); - connectViewWalletStore.getState().setClickedSignature(true); - } else { - logger.debug("[Connect Wallet] User clicked on initial sign button"); - connectViewWalletStore.getState().setLoading(true); - initXmtpClient(); - } - }, [waitingForNextSignature, connectViewWalletStore, initXmtpClient]); + const primaryButtonAction = useCallback(() => { + logger.debug("[Connect Wallet] User clicked on sign button"); + connectViewWalletStore.getState().setLoading(true); + initXmtpClient(); + }, [connectViewWalletStore, initXmtpClient]);
Remove second signature states and their related logic
The verification confirms that second signature states are still present and actively used across multiple files:
ConnectViaWallet.store.tsx
:
- Contains state definitions:
numberOfSignaturesDone
,waitingForNextSignature
- Includes setters:
setNumberOfSignaturesDone
,setWaitingForNextSignature
ConnectViaWallet.tsx
:
- Uses these states in component logic and effects
useConnectViaWalletInitXmtpClient.tsx
:
- Contains logic depending on
waitingForNextSignature
andnumberOfSignaturesDone
These states and their related logic should be removed as part of removing second signature handling.
🔗 Analysis chain
Line range hint
108-120
: Verify state management completenessThe component still destructures waitingForNextSignature and signaturesDone from the store, but these states should be removed as part of removing second signature handling.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Check for any remaining references to second signature states rg "waitingForNextSignature|signaturesDone|numberOfSignaturesDone" -A 2Length of output: 4283
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (5)
components/Onboarding/ConnectViaWallet/ConnectViaWallet.store.tsx
(0 hunks)components/Onboarding/ConnectViaWallet/ConnectViaWallet.tsx
(2 hunks)components/Onboarding/ConnectViaWallet/useConnectViaWalletInitXmtpClient.tsx
(0 hunks)components/Onboarding/ConnectViaWallet/useInitConnectViaWalletState.ts
(3 hunks)i18n/translations/en.ts
(0 hunks)
💤 Files with no reviewable changes (3)
- components/Onboarding/ConnectViaWallet/ConnectViaWallet.store.tsx
- i18n/translations/en.ts
- components/Onboarding/ConnectViaWallet/useConnectViaWalletInitXmtpClient.tsx
🔇 Additional comments (4)
components/Onboarding/ConnectViaWallet/useInitConnectViaWalletState.ts (3)
13-15
: LGTM: Clean import organization
The new imports are properly organized and provide necessary utilities for error handling and XMTP integration.
116-116
: Verify consumers of useInitConnectViaWalletState
The removal of onXmtp from the return value is a breaking change. Ensure all consumers are updated accordingly.
85-90
: Verify error handling for getInboxId
The Promise.all now only retrieves inboxId. While this simplifies the code, ensure that getInboxId's error handling is robust since it's a critical path for wallet initialization.
✅ Verification successful
Error handling for getInboxId is properly implemented
The code has appropriate error handling:
- The
getInboxId
call is wrapped in a try-catch block - Errors are properly logged with
logger.error
- Errors are propagated to the UI via
onErrorConnecting
- The initialization state is properly cleaned up in the
finally
block
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Check error handling in getInboxId implementation
ast-grep --pattern 'function getInboxId($_) {
try {
$$$
} catch($_) {
$$$
}
}'
Length of output: 94
Script:
#!/bin/bash
# Let's try to find the getInboxId implementation with a broader search
rg "getInboxId" -A 10
Length of output: 6376
Script:
#!/bin/bash
# Let's check the implementation and error handling in Client.getOrCreateInboxId
rg "Client\.getOrCreateInboxId" -A 5 -B 5
# Also check if there's any try-catch around the usage of getInboxId in useInitConnectViaWalletState
rg -A 10 -B 5 "useInitConnectViaWalletState"
Length of output: 5466
Script:
#!/bin/bash
# Let's check the error handling in the component where getInboxId is used
rg -A 20 -B 5 "const \[inboxId\]" components/Onboarding/ConnectViaWallet/useInitConnectViaWalletState.ts
Length of output: 980
components/Onboarding/ConnectViaWallet/ConnectViaWallet.tsx (1)
82-83
: LGTM: Clean state destructuring
The state destructuring has been properly updated to remove onXmtp, aligning with the changes in useInitConnectViaWalletState.
components/Onboarding/ConnectViaWallet/useInitConnectViaWalletState.ts
Outdated
Show resolved
Hide resolved
components/Onboarding/ConnectViaWallet/useInitConnectViaWalletState.ts
Outdated
Show resolved
Hide resolved
* fix: Wallet Connect Removed Second Signature Handling Removed check for isOnXmtp network Removed unused translations * remove commented code and promise.all
Removed Second Signature Handling
Removed check for isOnXmtp network
Removed unused translations
Summary by CodeRabbit
Release Notes
New Features
onXmtp
property, simplifying user interface prompts.Bug Fixes
Documentation
secondSignature
prompt, reducing user information overload.