Skip to content

Commit

Permalink
Fixed deltadecode failure recovery test
Browse files Browse the repository at this point in the history
  • Loading branch information
sacOO7 committed Jan 30, 2024
1 parent f92ab59 commit d13051f
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions lib/src/main/java/io/ably/lib/realtime/ChannelBase.java
Original file line number Diff line number Diff line change
Expand Up @@ -251,10 +251,11 @@ private void attachImpl(final boolean forceReattach, final CompletionListener li
attachMessage.setFlags(options.getModeFlags());
}
}
if(this.decodeFailureRecoveryInProgress) {
Log.v(TAG, "attach(); message decode recovery in progress.");
}
attachMessage.channelSerial = properties.channelSerial; // RTL4c1
if(this.decodeFailureRecoveryInProgress) { // RTL18c
Log.v(TAG, "attach(); message decode recovery in progress, setting last message channelserial");
attachMessage.channelSerial = this.lastPayloadProtocolMessageChannelSerial;
}
try {
if (listener != null) {
on(new ChannelStateCompletionListener(listener, ChannelState.attached, ChannelState.failed));
Expand Down Expand Up @@ -838,6 +839,7 @@ private void onMessage(final ProtocolMessage protocolMessage) {
}

lastPayloadMessageId = lastMessage.id;
lastPayloadProtocolMessageChannelSerial = protocolMessage.channelSerial;

for (final Message msg : messages) {
this.listeners.onMessage(msg);
Expand Down Expand Up @@ -1340,6 +1342,7 @@ public void once(ChannelState state, ChannelStateListener listener) {
*/
private Set<ChannelMode> modes;
private String lastPayloadMessageId;
private String lastPayloadProtocolMessageChannelSerial;
private boolean decodeFailureRecoveryInProgress;
private final DecodingContext decodingContext;
}

0 comments on commit d13051f

Please sign in to comment.