Skip to content

Reject empty invite payloads in DM invite parsing#5

Open
applefather-eth wants to merge 1 commit intoxmtplabs:mainfrom
applefather-eth:codex/fix-txhash-invite-heuristic
Open

Reject empty invite payloads in DM invite parsing#5
applefather-eth wants to merge 1 commit intoxmtplabs:mainfrom
applefather-eth:codex/fix-txhash-invite-heuristic

Conversation

@applefather-eth
Copy link
Copy Markdown
Contributor

@applefather-eth applefather-eth commented Apr 2, 2026

This fixes another false positive in DM invite parsing.

Some short numeric messages such as 8118 and 6018 were being accepted by parseInviteSlug() as technically valid invites, but with an empty payload:

  • creatorInboxId = ""
  • tag = ""
  • conversationToken.length = 0

Because Convos DM middleware always attempts invite parsing first, those messages were treated as invite/join traffic and never reached downstream app handlers.

This reproduced locally with two fresh XMTP identities:

  • 8118 / 6018 were stored in the local XMTP DB
  • but onMessage never fired for them
  • while nearby values like 8373 and 5548 behaved normally

This patch makes parseInviteSlug() reject parsed invites that are missing required payload fields (creatorInboxId, tag, or conversationToken).

Also adds regression tests covering 8118 and 6018.

Note

Reject empty invite payloads in parseInviteSlug

Adds validation in parseInviteSlug after decoding the payload: throws Error("Invalid invite payload") if creatorInboxId is falsy, tag is missing, or conversationToken is empty. A new test covers inputs that decode to empty payloads (e.g. "8118", "6018").

Macroscope summarized a125229.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant