Skip to content

Commit

Permalink
Do not up clientId for message already containing clientId
Browse files Browse the repository at this point in the history
  • Loading branch information
caalador committed Jan 13, 2025
1 parent d28282b commit aefbb0a
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -228,8 +228,11 @@ public void send(final JsonObject payload) {
private void sendPayload(final JsonObject payload) {
payload.put(ApplicationConstants.SERVER_SYNC_ID,
registry.getMessageHandler().getLastSeenServerSyncId());
payload.put(ApplicationConstants.CLIENT_TO_SERVER_ID,
clientToServerMessageId++);
if (!payload.hasKey(ApplicationConstants.CLIENT_TO_SERVER_ID)) {
// We are resending the message so we should not up the clientId
payload.put(ApplicationConstants.CLIENT_TO_SERVER_ID,
clientToServerMessageId++);
}

if (!registry.getRequestResponseTracker().hasActiveRequest()) {
// Direct calls to send from outside probably have not started
Expand All @@ -238,7 +241,6 @@ private void sendPayload(final JsonObject payload) {
}

if (push != null && push.isBidirectional()) {
messageQueue.clear();
// When using bidirectional transport, the payload is not resent
// to the server during reconnection attempts.
// Keep a copy of the message, so that it could be resent to the
Expand Down

0 comments on commit aefbb0a

Please sign in to comment.