MDL-67700 message: prevent async loading conversation message mix

This commit is contained in:
Ferran Recio
2020-05-21 18:04:31 +02:00
parent fcbc4ccee6
commit 0efd87b0f2
3 changed files with 14 additions and 2 deletions
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -506,6 +506,18 @@ function(
newestFirst,
timeFrom
)
.then(function(result) {
// Prevent older requests from contaminating the current view.
if (result.id != viewState.id) {
result.messages = [];
// Purge old conversation cache to prevent messages lose.
if (result.id in stateCache) {
delete stateCache[result.id];
}
}
return result;
})
.then(function(result) {
if (result.messages.length && ignoreList.length) {
result.messages = result.messages.filter(function(message) {