Commit b172861d authored by laszlovl's avatar laszlovl Committed by JC Brand

Dont run fetchRosterContacts async, to prevent processing presence before contacts are created

Fixes #1405
parent 4a5603ab
......@@ -7,6 +7,7 @@
- Accessibility: Tag the chat-content as an ARIA live region, for screen readers
- Set releases URL to new Github repo
- #1369 Don't wrongly interpret message with `subject` as a topic change.
- #1405 Status of contacts list are not displayed properly
- #1408 new config option `roomconfig_whitelist`
- #1412 muc moderator commands can be disabled selectively by config
- #1413 fix moderator commands that change affiliation
......
......@@ -68022,11 +68022,15 @@ _converse_headless_converse_core__WEBPACK_IMPORTED_MODULE_0__["default"].plugins
}
} else {
try {
await _converse.rostergroups.fetchRosterGroups().then(() => {
_converse.emit('rosterGroupsFetched');
/* Make sure not to run fetchRosterContacts async, since we need
* the contacts to exist before processing contacts presence,
* which might come in the same BOSH request.
*/
await _converse.rostergroups.fetchRosterGroups();
return _converse.roster.fetchRosterContacts();
});
_converse.emit('rosterGroupsFetched');
await _converse.roster.fetchRosterContacts();
_converse.emit('rosterContactsFetched');
} catch (reason) {
......@@ -68375,8 +68379,7 @@ _converse_headless_converse_core__WEBPACK_IMPORTED_MODULE_0__["default"].plugins
if (collection.length === 0 || this.rosterVersioningSupported() && !_converse.session.get('roster_fetched')) {
_converse.send_initial_presence = true;
_converse.roster.fetchFromServer();
await _converse.roster.fetchFromServer();
} else {
_converse.emit('cachedRoster', collection);
}
......@@ -88,10 +88,14 @@ converse.plugins.add('converse-roster', {
}
} else {
try {
await _converse.rostergroups.fetchRosterGroups().then(() => {
_converse.emit('rosterGroupsFetched');
return _converse.roster.fetchRosterContacts();
});
/* Make sure not to run fetchRosterContacts async, since we need
* the contacts to exist before processing contacts presence,
* which might come in the same BOSH request.
*/
await _converse.rostergroups.fetchRosterGroups();
_converse.emit('rosterGroupsFetched');
await _converse.roster.fetchRosterContacts();
_converse.emit('rosterContactsFetched');
} catch (reason) {
_converse.log(reason, Strophe.LogLevel.ERROR);
......@@ -403,7 +407,7 @@ converse.plugins.add('converse-roster', {
if (collection.length === 0 ||
(this.rosterVersioningSupported() && !_converse.session.get('roster_fetched'))) {
_converse.send_initial_presence = true;
_converse.roster.fetchFromServer();
await _converse.roster.fetchFromServer();
} else {
_converse.emit('cachedRoster', collection);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment