Fix `queue*()` methods
Change methods to only add a pending command, but not process the pending commands immediately.
Also, don't defer adding the pending command by using `putBackground()`. This can mess with the execution order of remote commands.
@@ -952,11 +952,8 @@ public class MessagingController {
}
private void queueSetFlag(Account account, long folderId, boolean newState, Flag flag, List<String> uids) {
- putBackground("queueSetFlag", null, () -> {
PendingCommand command = PendingSetFlag.create(folderId, newState, flag, uids);
queuePendingCommand(account, command);
- processPendingCommands(account);
- });
}
/**
@@ -969,11 +966,8 @@ public class MessagingController {
}
private void queueDelete(Account account, long folderId, List<String> uids) {
- putBackground("queueDelete", null, () -> {
PendingCommand command = PendingDelete.create(folderId, uids);
queuePendingCommand(account, command);
- processPendingCommands(account);
- });
}
void processPendingDelete(PendingDelete command, Account account) throws MessagingException {
