Skip to content

Commit

Permalink
Fixing potential handle action execution order issues.
Browse files Browse the repository at this point in the history
  • Loading branch information
dukhaSlayer authored Jan 22, 2025
1 parent d57442b commit efb808b
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
import java.io.IOException;
import java.time.Duration;
import java.util.Collection;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedHashMap;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
Expand Down Expand Up @@ -92,7 +92,7 @@ public void receiveMessages(
hasCaughtUpWithOldMessages = false;

// Use a Map here because java Set doesn't have a get method ...
Map<HandleAction, HandleAction> queuedActions = new HashMap<>();
Map<HandleAction, HandleAction> queuedActions = new LinkedHashMap<>();

final var signalWebSocket = dependencies.getSignalWebSocket();
final var webSocketStateDisposable = Observable.merge(signalWebSocket.getUnidentifiedWebSocketState(),
Expand Down Expand Up @@ -255,7 +255,7 @@ private void receiveMessagesInternal(
}

private void retryFailedReceivedMessages(Manager.ReceiveMessageHandler handler) {
Set<HandleAction> queuedActions = new HashSet<>();
Set<HandleAction> queuedActions = new LinkedHashSet<>();
for (var cachedMessage : account.getMessageCache().getCachedMessages()) {
var actions = retryFailedReceivedMessage(handler, cachedMessage);
if (actions != null) {
Expand Down

0 comments on commit efb808b

Please sign in to comment.