Synchronizing roster with the jabber server while user is offline

116 Views Asked by At

I am using ejabbered with converse.js and I am playing around with user administration on ejabberd admin panel, more precisely with adding/removing a user from and to a shared group.

While the user is online(converse client is connected to the server) any changes I do in admin panel are reflected in the client immediately. When I add or remove user to and from a group, contacts are updated appropriately. I can also see the roster add/remove messages in the websocket connection as I submit changes in the admin panel.

While user is offline(converse client is not connected) and I add the user to the new shared group, next time user connects, he will see the updated contact list(new contacts are added on the client), BUT if I remove the user from a shared group while he is offline, next time he comes online, the roster will not be changed. Even if I click the contacts refresh button, no contact will be removed.

In order words, only roster additions are respected while user is offline.

Now I kinda understand what's going on, since "remove" message is essentially missed by the client, but I am still wondering, is there any way to synchronize roster items between conversejs and ejabberd in such a way that they are 1 to 1 even while user is offline?

1

There are 1 best solutions below

0
On

I can reproduce that problem using ejabberd from git and Converse 9.1.0. It seems Converse stores the roster in the webbrowser, and restores it at login, probably to save network consumption.

I disabled this option in Converse, and now the roster is requested at every login: https://conversejs.org/docs/html/configuration.html#clear-cache-on-logout

Offtopic: during the last weeks, I've added some improvements to administer mod_conversejs, see https://github.com/processone/ejabberd/commits/master/src/mod_conversejs.erl