Skip to content

Commit

Permalink
Merge pull request #864 from ably/feature/revert-protocol-1-0
Browse files Browse the repository at this point in the history
Revert to protocol 1.0
  • Loading branch information
QuintinWillison authored Nov 24, 2022
2 parents 2d0d542 + efaab30 commit d31f526
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 5 deletions.
9 changes: 7 additions & 2 deletions lib/src/main/java/io/ably/lib/transport/Defaults.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,14 @@
import java.util.Locale;

public class Defaults {
/* versions */
public static final float ABLY_VERSION_NUMBER = 1.1f;
public static final float ABLY_VERSION_NUMBER = 1.0f;

/**
* The level of compatibility with the Ably service that this SDK supports, also referred to as the 'wire protocol version'.
* This value is presented as a string, as specified in G4a.
*/
public static final String ABLY_VERSION = new DecimalFormat("0.0", new DecimalFormatSymbols(Locale.ENGLISH)).format(ABLY_VERSION_NUMBER);

public static final String ABLY_AGENT_VERSION = String.format("%s/%s", "ably-java", BuildConfig.VERSION);

/* params */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public void realtime_websocket_param_test() {
* Defaults.ABLY_VERSION_PARAM, as ultimately the request param has been derived from those values.
*/
assertEquals("Verify correct version", requestParameters.get("v"),
Collections.singletonList("1.1"));
Collections.singletonList("1.0"));

/* Spec RSC7d3
* This test should not directly validate version against Defaults.ABLY_AGENT_VERSION, nor
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public void header_lib_channel_publish() {
* from those values.
*/
Assert.assertNotNull("Expected headers", headers);
Assert.assertEquals(headers.get("x-ably-version"), "1.1");
Assert.assertEquals(headers.get("x-ably-version"), "1.0");
Assert.assertEquals(headers.get("ably-agent"), expectedAblyAgentHeader);
} catch (AblyException e) {
e.printStackTrace();
Expand Down
2 changes: 1 addition & 1 deletion lib/src/test/java/io/ably/lib/transport/DefaultsTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ public class DefaultsTest {

@Test
public void versions() {
assertThat(Defaults.ABLY_VERSION, is("1.1"));
assertThat(Defaults.ABLY_VERSION, is("1.0"));
}

@Test
Expand Down

0 comments on commit d31f526

Please sign in to comment.