MDL-67700 message: prevent async loading conversation message mix

This commit is contained in:
Ferran Recio 2020-05-21 15:26:52 +02:00
parent 99374e7e14
commit 778846987a
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

View File

@ -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) {