Ignore remote echos caused by this client
by sending each tag_ordering with a _storeId and ignoring accout data that has a matching _storeId. This will tend to become out of sync with the server over time if requests continually fail, but subsequent successful requests will rectify any differences.
This commit is contained in:
@@ -42,9 +42,14 @@ TagOrderActions.moveTag = function(matrixClient, tag, destinationIx) {
|
||||
tags = tags.filter((t) => t !== tag);
|
||||
tags = [...tags.slice(0, destinationIx), tag, ...tags.slice(destinationIx)];
|
||||
|
||||
const storeId = TagOrderStore.getStoreId();
|
||||
|
||||
return asyncAction('TagOrderActions.moveTag', () => {
|
||||
Analytics.trackEvent('TagOrderActions', 'commitTagOrdering');
|
||||
return matrixClient.setAccountData('im.vector.web.tag_ordering', {tags});
|
||||
return matrixClient.setAccountData(
|
||||
'im.vector.web.tag_ordering',
|
||||
{tags, _storeId: storeId},
|
||||
);
|
||||
}, () => {
|
||||
// For an optimistic update
|
||||
return {tags};
|
||||
|
||||
Reference in New Issue
Block a user