Skip to content

Commit

Permalink
Annotated missing spec implementation for the presence code
Browse files Browse the repository at this point in the history
  • Loading branch information
sacOO7 committed Dec 20, 2023
1 parent 088f96b commit 2384c4e
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion lib/src/main/java/io/ably/lib/realtime/AblyRealtime.java
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public void onConnectionStateChanged(ConnectionStateListener.ConnectionStateChan
if (!StringUtils.isNullOrEmpty(options.recover)) {
RecoveryKeyContext recoveryKeyContext = RecoveryKeyContext.decode(options.recover);
if (recoveryKeyContext != null) {
setChannelSerialsFromRecoverOption(recoveryKeyContext.getChannelSerials());
setChannelSerialsFromRecoverOption(recoveryKeyContext.getChannelSerials()); // RTN16j
connection.connectionManager.msgSerial = recoveryKeyContext.getMsgSerial(); //RTN16f
}
}
Expand Down
2 changes: 1 addition & 1 deletion lib/src/main/java/io/ably/lib/realtime/Connection.java
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public class Connection extends EventEmitter<ConnectionEvent, ConnectionStateLis
* current @msgSerial@, and a collection of pairs of channel @name@ and current @channelSerial@ for every
* currently attached channel.
* <p>
* Spec: RTN16g
* Spec: RTN16g, RTN16c
* </p>
*/
public String createRecoveryKey() {
Expand Down
2 changes: 1 addition & 1 deletion lib/src/main/java/io/ably/lib/realtime/Presence.java
Original file line number Diff line number Diff line change
Expand Up @@ -1238,7 +1238,7 @@ public String memberKey(PresenceMessage item) {
}

private final PresenceMap presence = new PresenceMap();
private final PresenceMap internalPresence = new InternalPresenceMap();
private final PresenceMap internalPresence = new InternalPresenceMap(); // RTP17

/************************************
* general
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1206,10 +1206,10 @@ private synchronized void onConnected(ProtocolMessage message) {
Log.d(TAG, "connection resume success with non-fatal error: " + message.error.message);
}
addPendingMessagesToQueuedMessages(false);
} else { // RTN15c7, RTN16d - resume failure
} else { // RTN15c7, RTN16d - resume failure
if (message.error != null) {
Log.d(TAG, "connection resume failed with error: " + message.error.message);
}else { // This shouldn't happen but, putting it here for safety
} else { // This shouldn't happen but, putting it here for safety
Log.d(TAG, "connection resume failed without error" );
}

Expand Down Expand Up @@ -1262,7 +1262,7 @@ private synchronized List<QueuedMessage> extractConnectionQueuePresenceMessages(

/**
* Add all pending queued messages to the front of QueuedMessages for them to be sent later
* Spec: RTN19a
* Spec: RTN19a, RTN19a1, RTN19a2
* @param resetMessageSerial whether to reset message serial, this will determine whether to reset message serials
* on pending queue, for example when a connection resume failed
*/
Expand Down
2 changes: 1 addition & 1 deletion lib/src/main/java/io/ably/lib/transport/ITransport.java
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public Param[] getConnectParams(Param[] baseParams) {
paramList.add(new Param("echo", "false"));
if(!StringUtils.isNullOrEmpty(connectionKey)) {
mode = Mode.resume;
paramList.add(new Param("resume", connectionKey));
paramList.add(new Param("resume", connectionKey)); // RTN15b1
} else if(!StringUtils.isNullOrEmpty(options.recover)) { // RTN16k
mode = Mode.recover;
RecoveryKeyContext recoveryKeyContext = RecoveryKeyContext.decode(options.recover);
Expand Down

0 comments on commit 2384c4e

Please sign in to comment.