Skip to content

Commit

Permalink
Process stanzas from mam one-by-one
Browse files Browse the repository at this point in the history
  • Loading branch information
ChaosKid42 authored and jcbrand committed Sep 21, 2019
1 parent 51b818f commit cd5dacb
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGES.md
Expand Up @@ -5,6 +5,8 @@
- Bugfix: Don't treat every duplicate message ID as a message correction; since some
clients don't use globally unique ID's this causes false positives.
- #1712: `TypeError: plugin._features is not a function`
- Bugfix: process stanzas from mam one-by-one in order to correctly process message
receipts

## 5.0.3 (2019-09-13)

Expand Down
9 changes: 8 additions & 1 deletion src/headless/converse-mam.js
Expand Up @@ -126,7 +126,14 @@ converse.plugins.add('converse-mam', {
}, options);

const result = await _converse.api.archive.query(query);
result.messages.forEach(message_handler);
/* eslint-disable no-await-in-loop */
for (const message of result.messages) {
try {
await message_handler(message);
} catch (e) {
_converse.log(e, Strophe.LogLevel.ERROR);
}
}

if (result.error) {
result.error.retry = () => this.fetchArchivedMessages(options, page);
Expand Down

0 comments on commit cd5dacb

Please sign in to comment.