Skip to content

Add friend shows 'This invite was already used' for every unknown, mistyped or truncated invite link (regression of #310) #347

Closed

Description

@Birfy

Summary

In Add friend, any invite link that the server does not know (mistyped, truncated, pasted with stray characters, from a deleted invite, from another server) is shown as "This invite was already used. Ask your friend for a new one." The "already used" line is wrong for all of them. The client has the correct "wasn't found" sentence, but errorText rewrites it. This hides the real problem and sends Danyang to "ask for a new link" for a link that was never used. It is a regression of #310 / #312.

Cause

mapJoinInviteError (social.js) answers invite_not_found with: "This invite link wasn't found. It may be incomplete, expired, or already used. Ask your friend for a new link." (and the "wasn't found on your Bot Social server… or already used" variant for a foreign host).
errorText (plugins/social/client.js) then runs /invite_unavailable|invite is used|invite_used|already used/i on the message. The words "already used" in the not-found sentence match, so it is replaced by "This invite was already used…". The run() wrapper has the same loose test (/already used|already friends/), so the "Accepting invite failed:" prefix is also dropped. The foreign-host wording from #310 can never be seen.

Reproduction (real UI, headless Chrome, prod Bot Social, main 2c9853d / d6203fd)

On a fresh home: + → Add friend → paste any of these → Accept invite:

  • https://47-80-69-220.sslip.io/i/ZZZZunknown99 → "This invite was already used. Ask your friend for a new one."
  • hello world → same
  • a real link with its last 3 characters cut → same
  • https://example.org/i/ZZZZunknown99 → same (expected: "wasn't found on your Bot Social server… another server")
    The plugin log/raw error for all of them is invite_not_found (checked with a debug line on the join call). A really used invite and a revoked invite give the right lines ("already used" / "no longer valid").

Expected

Unknown links show the "wasn't found" sentence (foreign host: the "another server" sentence), with the usual "Accepting invite failed:" prefix. Only an invite the server says is used shows "already used".

Also found in the same test (not part of this fix)

  • Accepting an invite never shows the inviter's Bot to the joiner, and the joiner's Chief lists the inviter in People with access (regression of #178 from #334) #342 (join succeeds, joiner never sees the inviter's Bot) is the bigger reason Add friend looks broken on main; the toast even says "shared a Bot with you" while nothing appears. A retry then says "already used" (same invite) or "You're already friends. Their Bot is back in your list." (a new invite for the same Bot), neither of which is true for the user.
  • A link on another server's host with a code that exists on this server is accepted (the host is ignored).
  • Friend requests that stay pending (invite made with auto_accept=false, e.g. by an AI Bot over MCP) never show in Add friend: social/overview lists friends only for the home Bot (list_friends with the home id), but the join comes from a member Bot, so "Waiting for them to accept" / "Friend requests" stay empty although the server holds a pending_target relationship.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions