-
Notifications
You must be signed in to change notification settings - Fork 9
feat: add XMTP v3 direct messaging #194
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
Conversation
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.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 74cf610013
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const handleEnable = async () => { | ||
| await initialize(); | ||
| if (!error) { | ||
| onOpenChange(false); | ||
| } |
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.
Don’t close onboarding dialog on failed init
The dialog closes based on the error value captured before initialize() runs. Because error is updated asynchronously in XmtpContext, a failed initialization (e.g., user rejects the signature or the SDK throws) can still hit if (!error) and close the dialog, hiding the failure and leaving XMTP uninitialized. Consider making initialize() return a success boolean/throw on failure or checking the post-call state before closing.
Useful? React with 👍 / 👎.
| // Cleanup on unmount or wallet disconnect | ||
| useEffect(() => { | ||
| if (!isConnected && client) { | ||
| disconnect(); | ||
| } |
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.
Reset XMTP client on account change
The provider only disconnects when isConnected becomes false, so switching wallets while staying connected leaves the previous XMTP client active. In that scenario, the UI continues to show/send messages for the old inbox even though address has changed. This can confuse users and leak the wrong account’s inbox. Include the address in the disconnect logic (or recreate the client) when it changes.
Useful? React with 👍 / 👎.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Summary
Integrates XMTP v3 (MLS-based encryption) for direct messaging, enabling users to:
Implementation Details
/messagesTesting Checklist