Gateway presence not re-sent after reconnecting to the server #3
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Gateway presence not re-sent after reconnecting to the server
What happens
After ejabberd restarts, linked users can be left without the gateway's
presence: their client shows the gateway offline / "Not linked" until the
client itself reconnects.
On xmpp.asxp.io (stack recreated at 18:04): the engine reported the account
readyat 18:04:47 (updates running), the component reached ejabberd at18:04:50 after two refused attempts.
sendGatewayPresenceran on the statechange, while the component stream was down, so that presence was lost; the
user's client probed while the component was still disconnected. A manual
probe at 18:25 got the expected available presence.
Why
component/gateway.tcl:sendGatewayPresenceruns only on an account statechange (
onEngineEventstate) and on a probe/available from the user(
onPresence). Nothing runs it when the component's stream (re)connects(
ready as telegram.<domain> (fresh bind)).Fix
On every component ready (fresh bind or reconnect), send
sendGatewayPresenceto each account inacct, and once M1 lands, the peers'last known presence too. Optionally probe each linked user so their current
presence is known after a restart.
Related
Peer presence is not forwarded at all yet:
onEngineEventdropsuser_status(gateway.tcl:129), and a subscription to<id>@telegram.<domain>is answered
subscribedwith no presence afterwards (M1 per DESIGN.md).Environment
feat/telegram-connectatcb68dd9, anotherim-server compose deployment(ejabberd 26.09).
Addressed in
58b32c7(main). Atcb68dd9main.tcl's ready handler did resend the presence, so I could not reproduce the loss as described, but the path is now belt and braces: on every component ready each linked user gets the gateway's presence again plus a probe, and the engine's account list sends it too when the stream came up before the accounts were known. The end-to-end test now restarts the gateway mid-run and checks the presence comes back without a probe from the client. If it still happens on a real restart, the component's log aroundconnected asat-log debugwould help.