matrix-org / matrix-org/matrix-bifrost

Ghost sessions

Open
#298 2 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

S-Major T-Defect
Dominant language
TypeScript
Stars
187
Forks
38
PR merge metrics
No merged PRs in 30d

Description

Observation: Many of copies of the same stanza like <message type="groupchat" from="#room_example@matrix.org" to="me@example.org/RANDOM_VARYING">

Theory: When disconnecting, sometimes the <presence type="unavailable"/> does not make it to the bridge. If the server policy is to generate a random resource (the JID resource part is a session identifier, not a device identifier!) then these eventually add up in MUCs and the like if not removed.

Background: In XMPP / MUC, clients that silently go offline without the MUC being told end up as "ghosts", appearing to be still present but aren't. These are normally removed when an attempt to deliver a groupchat message to them results in an error returned to the MUC. These kinds of problems were common in XMPP long ago, but were mostly fixed.

Solution: Watch for <message type="error"> in response to groupchat messages, check whether the error condition points to non-deliverability (e.g. one of these) and then remove the user.

Might be a duplicate of #53

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the bridge's XMPP/MUC groupchat delivery and error handling; the issue names no repository files or tests. Compare non-deliverability conditions with the linked Prosody MUC conditions and check the possible duplicate, #53. Done means non-deliverable groupchat recipients are removed without treating other message errors as evidence of a ghost session.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.