Skip to content

Commit 954ed28

Browse files
authored
Merge pull request #1199 from ably/feature/integration-2.0
[SDK-3703] Feature/integration 2.0
2 parents b359101 + 5507611 commit 954ed28

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+1283
-1121
lines changed

.github/workflows/package.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ jobs:
1818
with:
1919
dotnet-version: |
2020
3.1.x
21-
6.0.x
22-
7.0.x
21+
6.0.403
22+
7.0.100
2323
- name: Download fake-cli
2424
run: dotnet tool restore
2525
- name: Package
@@ -45,8 +45,8 @@ jobs:
4545
with:
4646
dotnet-version: |
4747
3.1.x
48-
6.0.x
49-
7.0.x
48+
6.0.403
49+
7.0.100
5050
- name: Download fake-cli
5151
run: dotnet tool install fake-cli --version 5.20.4 --tool-path .
5252
- name: Restore packages
@@ -73,7 +73,7 @@ jobs:
7373
with:
7474
dotnet-version: |
7575
2.x.x
76-
6.x.x
76+
6.0.403
7777
7878
# Checkout unity packager
7979
- name: Checkout unity-packager repo

.github/workflows/run-tests-linux.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ jobs:
2424
uses: actions/setup-dotnet@v3
2525
with:
2626
dotnet-version: |
27-
6.0.x
28-
7.0.x
27+
6.0.403
28+
7.0.100
2929
3030
- name: Download dotnet build-script tools
3131
run: dotnet tool restore

.github/workflows/run-tests-macos.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ jobs:
2424
uses: actions/setup-dotnet@v3
2525
with:
2626
dotnet-version: |
27-
6.0.x
28-
7.0.x
27+
6.0.403
28+
7.0.100
2929
3030
- name: Download dotnet build-script tools
3131
run: dotnet tool restore

.github/workflows/run-tests-windows.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ jobs:
2424
uses: actions/setup-dotnet@v3
2525
with:
2626
dotnet-version: |
27-
6.0.x
28-
7.0.x
27+
6.0.403
28+
7.0.100
2929
3030
- name: Download dotnet build-script tools
3131
run: dotnet tool restore

src/IO.Ably.Shared/AblyRealtime.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ internal AblyRealtime(ClientOptions options, Func<ClientOptions, IMobileDevice,
6767
RestClient = createRestFunc != null ? createRestFunc.Invoke(options, mobileDevice) : new AblyRest(options, mobileDevice);
6868
Push = new PushRealtime(RestClient, Logger);
6969

70-
Connection = new Connection(this, options.NowFunc, options.Logger);
70+
Connection = new Connection(this, options.NowFunc, Logger);
7171
Connection.Initialise();
7272

7373
if (options.AutomaticNetworkStateMonitoring)

src/IO.Ably.Shared/ClientOptions.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ internal string GetClientId()
9191
/// <summary>
9292
/// A connection recovery string, specified by a client when initializing the library
9393
/// with the intention of inheriting the state of an earlier connection. See the Ably
94-
/// Realtime API documentation for further information on connection state recovery.
94+
/// Realtime API documentation for further information on connection state recovery. (RTN16i)
9595
/// Default: null.
9696
/// </summary>
9797
public string Recover { get; set; }
@@ -358,7 +358,7 @@ public bool UseBinaryProtocol
358358
/// Default before 1.2: false.
359359
/// Default from 1.2: true.
360360
/// </summary>
361-
public bool IdempotentRestPublishing { get; set; } = Defaults.ProtocolVersionNumber >= 1.2;
361+
public bool IdempotentRestPublishing { get; set; } = true;
362362

363363
/// <summary>
364364
/// Additional parameters to be sent in the querystring when initiating a realtime connection.

src/IO.Ably.Shared/Defaults.cs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,8 @@
66

77
namespace IO.Ably
88
{
9-
internal static class Defaults
9+
internal class Defaults
1010
{
11-
internal static readonly float ProtocolVersionNumber = 1.2F;
12-
1311
internal static readonly string LibraryVersion = GetVersion();
1412

1513
internal static string GetVersion()
@@ -18,7 +16,7 @@ internal static string GetVersion()
1816
return version.Split('.').Take(3).JoinStrings(".");
1917
}
2018

21-
public static string ProtocolVersion { get; } = ProtocolVersionNumber.ToString(CultureInfo.InvariantCulture);
19+
public const string ProtocolVersion = "2"; // CSV2
2220

2321
public const int QueryLimit = 100;
2422

src/IO.Ably.Shared/Extensions/PresenceExtensions.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,16 @@ public static bool IsSynthesized(this PresenceMessage msg)
77
return msg.Id == null || !msg.Id.StartsWith(msg.ConnectionId);
88
}
99

10+
// RTP2b, RTP2c
1011
public static bool IsNewerThan(this PresenceMessage thisMessage, PresenceMessage thatMessage)
1112
{
13+
// RTP2b1
1214
if (thisMessage.IsSynthesized() || thatMessage.IsSynthesized())
1315
{
1416
return thisMessage.Timestamp > thatMessage.Timestamp;
1517
}
1618

19+
// RTP2b2
1720
var thisValues = thisMessage.Id.Split(':');
1821
var thatValues = thatMessage.Id.Split(':');
1922

src/IO.Ably.Shared/Http/AblyHttpClient.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ internal void SetPreferredHost(string currentHost)
7373
internal void CreateInternalHttpClient(TimeSpan timeout, HttpMessageHandler messageHandler)
7474
{
7575
Client = messageHandler != null ? new HttpClient(messageHandler) : new HttpClient();
76-
Client.DefaultRequestHeaders.Add("X-Ably-Version", Defaults.ProtocolVersion);
76+
Client.DefaultRequestHeaders.Add("X-Ably-Version", Defaults.ProtocolVersion); // RSC7a
7777
Client.DefaultRequestHeaders.Add(Agent.AblyAgentHeader, Agent.AblyAgentIdentifier(Options.Agents)); // RSC7d
7878
Client.Timeout = timeout;
7979
}

src/IO.Ably.Shared/IO.Ably.Shared.projitems

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@
5555
<Compile Include="$(MSBuildThisFileDirectory)Realtime\Presence.GetParams.cs" />
5656
<Compile Include="$(MSBuildThisFileDirectory)Realtime\Presence.QueuedPresenceMessage.cs" />
5757
<Compile Include="$(MSBuildThisFileDirectory)Realtime\PresenceMap.cs" />
58+
<Compile Include="$(MSBuildThisFileDirectory)Realtime\RecoveryKeyContext.cs" />
5859
<Compile Include="$(MSBuildThisFileDirectory)Realtime\Workflows\ChannelCommands.cs" />
5960
<Compile Include="$(MSBuildThisFileDirectory)Realtime\Workflows\IQueueCommand.cs" />
6061
<Compile Include="$(MSBuildThisFileDirectory)Realtime\Workflows\PingRequest.cs" />

0 commit comments

Comments
 (0)