Files
simplex-chat/src
Narasimha-sc 226c43f395 core: report an invitation the agent already used
Accepting a contact request that was already accepted reached the user as

  error agent CMD PROHIBITED SEInvitationNotFound acceptContact, invitationId = "..."

The chat layer cannot tell that case from an accept that failed: the contact
connection is committed at ConnNew before acceptContact is called, and a
successful accept leaves it at ConnNew as well, until the peer's CONF arrives.
A guard on the connection would reject retrying an accept that failed with a
network error - covered by "retry connecting via contact link".

The agent can tell, because it owns the invitation and clears it in the right
order: getInvitation requires accepted = 0, joinConn can fail, and only then
does acceptInvitation set accepted = 1. So SEInvitationNotFound means the
request was accepted, while a join that failed leaves the invitation for the
retry to find. Its CMD PROHIBITED is translated rather than re-derived; within
acceptContact' that error has no other source.
2026-08-20 14:49:16 +00:00
..