Skip to content

Commit

Permalink
[ECO-5139] chore: remove version field for now
Browse files Browse the repository at this point in the history
Version is not needed for Chat SDK for now
  • Loading branch information
ttypic committed Nov 27, 2024
1 parent 91e85ca commit addebf3
Showing 1 changed file with 0 additions and 20 deletions.
20 changes: 0 additions & 20 deletions lib/src/main/java/io/ably/lib/types/Message.java
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,6 @@ public class Message extends BaseMessage {
*/
public String serial;

/**
* (TM2p) version string – an opaque string that uniquely identifies the message, and is different for different versions.
* If a message received from Ably over a realtime transport does not contain a version,
* the SDK must set it to <channelSerial>:<padded_index> from the channelSerial field of the enclosing ProtocolMessage,
* and padded_index is the index of the message inside the messages array of the ProtocolMessage,
* left-padded with 0s to three digits (for example, the second entry might be foo:001)
*/
public String version;

/**
* (TM2j) action enum
*/
Expand All @@ -71,7 +62,6 @@ public class Message extends BaseMessage {
private static final String EXTRAS = "extras";
private static final String CONNECTION_KEY = "connectionKey";
private static final String SERIAL = "serial";
private static final String VERSION = "version";
private static final String ACTION = "action";

/**
Expand Down Expand Up @@ -168,10 +158,6 @@ void writeMsgpack(MessagePacker packer) throws IOException {
packer.packString(SERIAL);
packer.packString(serial);
}
if(version != null) {
packer.packString(VERSION);
packer.packString(version);
}
if(action != null) {
packer.packString(ACTION);
packer.packInt(action.ordinal());
Expand All @@ -197,8 +183,6 @@ Message readMsgpack(MessageUnpacker unpacker) throws IOException {
extras = MessageExtras.read(unpacker);
} else if (fieldName.equals(SERIAL)) {
serial = unpacker.unpackString();
} else if (fieldName.equals(VERSION)) {
version = unpacker.unpackString();
} else if (fieldName.equals(ACTION)) {
action = MessageAction.tryFindByOrdinal(unpacker.unpackInt());
} else {
Expand Down Expand Up @@ -359,7 +343,6 @@ protected void read(final JsonObject map) throws MessageDecodeException {
}

serial = readString(map, SERIAL);
version = readString(map, VERSION);
Integer actionOrdinal = readInt(map, ACTION);
action = actionOrdinal == null ? null : MessageAction.tryFindByOrdinal(actionOrdinal);
}
Expand All @@ -380,9 +363,6 @@ public JsonElement serialize(Message message, Type typeOfMessage, JsonSerializat
if (message.serial != null) {
json.addProperty(SERIAL, message.serial);
}
if (message.version != null) {
json.addProperty(VERSION, message.version);
}
if (message.action != null) {
json.addProperty(ACTION, message.action.ordinal());
}
Expand Down

0 comments on commit addebf3

Please sign in to comment.