Repository navigation
Conversation
Ethereum addresses are case-insensitive. XMTP_OWNER_ADDRESS is user-provided and may be checksummed, while getSenderAddress() may return a different casing, so a strict === comparison can lock the owner out of their own agent.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
isFromOwnercompares the sender address toXMTP_OWNER_ADDRESSwith strict===:Ethereum addresses are case-insensitive.
XMTP_OWNER_ADDRESSis provided by the user (commonly copied from a wallet or block explorer as an EIP-55 checksummed, mixed-case string), whilectx.getSenderAddress()returns the address in whatever casing the SDK produces. When the two casings differ, the strict comparison fails and the owner's own messages are silently ignored — the middleware locks the owner out of their own agent.Fix
Compare the addresses case-insensitively, keeping the check undefined-safe so a missing sender address still fails closed:
Verified with the project's
npm test(tsc --noEmit).Note
Fix
isFromOwnermiddleware to compare Ethereum addresses case-insensitivelyEthereum addresses can appear in mixed case (e.g. EIP-55 checksum format), so a strict equality check can incorrectly reject valid owners. isFromOwner.ts now lowercases both
senderAddressandownerAddressbefore comparing, and uses optional chaining onsenderAddressto avoid errors when it is undefined.Macroscope summarized cad444d.