Fix MUC room join presence detection (prevents pending messages)#63
Open
phwizard wants to merge 1 commit intodappros:mainfrom
Open
Fix MUC room join presence detection (prevents pending messages)#63phwizard wants to merge 1 commit intodappros:mainfrom
phwizard wants to merge 1 commit intodappros:mainfrom
Conversation
Some XMPP servers (incl. ejabberd) do not reliably echo the presence stanza 'id' attribute. Our join helper waited for id="presenceInRoom" and timed out, causing join retries and keeping messages stuck as pending (no double-tick/"green ticks") while also triggering presence resend logic after "Only occupants are allowed" errors. Detect MUC join presence using from=roomJID/resource + MUC <x xmlns> and avoid rejecting on timeout (best-effort join), preventing the pending-message loop.
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.
Summary
presenceInRoom()to not rely on the server echoingid=presenceInRoomin presence stanzas.from=roomJID/resource+ MUC<x xmlns=...>, which is consistent with ejabberd and other servers.Why this is needed
In real deployments we observed that the web client can connect (XMPP echo healthcheck OK) but UI never shows the double/green tick for sent messages. In this codebase the tick is driven by whether the message remains in the local heap (pending). When join confirmation fails, the client can hit
Only occupants are allowed to send messages to the conference.errors, and the recovery handler repeatedly tries to send presence + (re)join, but join confirmation never arrives because the helper was waiting for an echoedidthat ejabberd does not reliably preserve.This change makes room join detection robust across servers and stops the "presence retry → resend queue → pending forever" failure mode.
Test plan
Notes
Local CI checks in this repo currently fail unrelated to this PR:
npm run lintfails because ESLint v9 expectseslint.config.*by default.npm run build:libfails due to missingreact-use-measureduring compilation.These failures existed before this change; this PR only updates the presence join helper.