Skip to content

Commit

Permalink
Merge branch 'feature/no-connection-serial' into feature/no-connectio…
Browse files Browse the repository at this point in the history
…n-serial-recovery-key
  • Loading branch information
sacOO7 committed Nov 28, 2023
2 parents c767de2 + 6461967 commit 1897227
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 0 deletions.
20 changes: 20 additions & 0 deletions lib/src/main/java/io/ably/lib/realtime/AblyRealtime.java
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,26 @@ public void transferToChannels(List<ConnectionManager.QueuedMessage> queuedMessa
private void clear() {
map.clear();
}

protected void setChannelSerialsFromRecoverOption(HashMap<String, String> serials) {
for (Map.Entry<String, String> entry : serials.entrySet()) {
String channelName = entry.getKey();
String channelSerial = entry.getValue();
Channel channel = this.get(channelName);
if (channel != null) {
channel.properties.channelSerial = channelSerial;
}
}
}

protected HashMap<String, String> getChannelSerials() {
HashMap<String, String> channelSerials = new HashMap<>();
for (Channel channel : this.values()) {
channelSerials.put(channel.name, channel.properties.channelSerial);
}
return channelSerials;
}

}

/********************
Expand Down
2 changes: 2 additions & 0 deletions lib/src/main/java/io/ably/lib/realtime/Connection.java
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,9 @@ public class Connection extends EventEmitter<ConnectionEvent, ConnectionStateLis
* for more information.
* <p>
* Spec: RTN16b, RTN16c
* @deprecated use createRecoveryKey method instead.
*/
@Deprecated
public String recoveryKey;

/**
Expand Down
8 changes: 8 additions & 0 deletions lib/src/main/java/io/ably/lib/types/ChannelProperties.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,13 @@ public class ChannelProperties {
*/
public String attachSerial;

/**
* ChannelSerial contains the channelSerial from latest ProtocolMessage of action type
* Message/PresenceMessage received on the channel.
* <p>
* Spec: CP2b, RTL15b
*/
public String channelSerial;

public ChannelProperties() {}
}

0 comments on commit 1897227

Please sign in to comment.