diff --git a/src/IO.Ably.Shared/Realtime/Presence.cs b/src/IO.Ably.Shared/Realtime/Presence.cs
index 69f677702..c098c15f1 100644
--- a/src/IO.Ably.Shared/Realtime/Presence.cs
+++ b/src/IO.Ably.Shared/Realtime/Presence.cs
@@ -40,8 +40,18 @@ internal Presence(IConnectionManager connection, RealtimeChannel channel, string
///
/// Has the sync completed.
+ /// RTP13
///
- public bool IsSyncComplete => MembersMap.SyncCompleted && !IsSyncInProgress;
+ ///
+ [Obsolete("This property is deprecated, use SyncComplete instead")]
+ public bool IsSyncComplete => SyncComplete;
+
+ ///
+ /// Checks if sync has completed
+ /// RTP13
+ ///
+ ///
+ public bool SyncComplete => MembersMap.SyncCompleted && !IsSyncInProgress;
///
/// Indicates whether there is currently a sync in progress.
@@ -153,7 +163,7 @@ private async Task WaitForSyncAsync()
// The InternalSync should be completed and the channels Attached or Attaching
void CheckAndSet()
{
- if (IsSyncComplete
+ if (SyncComplete
&& (_channel.State == ChannelState.Attached || _channel.State == ChannelState.Attaching))
{
tsc.TrySetResult(true);
diff --git a/src/IO.Ably.Tests.Shared/Realtime/PresenceSandboxSpecs.cs b/src/IO.Ably.Tests.Shared/Realtime/PresenceSandboxSpecs.cs
index e7619360c..c8d904496 100644
--- a/src/IO.Ably.Tests.Shared/Realtime/PresenceSandboxSpecs.cs
+++ b/src/IO.Ably.Tests.Shared/Realtime/PresenceSandboxSpecs.cs
@@ -81,7 +81,7 @@ public async Task WhenAttachingToAChannelWithNoMembers_PresenceShouldBeConsidere
await channel.WaitForAttachedState();
channel.State.Should().Be(ChannelState.Attached);
- channel.Presence.IsSyncComplete.Should().BeTrue();
+ channel.Presence.SyncComplete.Should().BeTrue();
}
[Theory]
@@ -110,7 +110,7 @@ public async Task WhenAttachingToAChannelWithMembers_PresenceShouldBeInProgress(
{
Logger.Debug("Test: Setting inSync to - " + channel2.Presence.MembersMap.SyncInProgress);
syncInProgress = channel2.Presence.IsSyncInProgress;
- syncComplete = channel2.Presence.IsSyncComplete;
+ syncComplete = channel2.Presence.SyncComplete;
awaiter.SetCompleted();
}
};
@@ -741,7 +741,7 @@ public async Task PresenceMap_WhenNotSyncingAndLeaveActionArrivesMemberKeyShould
// sync should not be in progress and initial an sync should have completed
channel.Presence.IsSyncInProgress.Should().BeFalse("sync should have completed");
- channel.Presence.IsSyncComplete.Should().BeTrue();
+ channel.Presence.SyncComplete.Should().BeTrue();
// pull a random member key from the presence map
var memberNumber = new Random().Next(0, 19);
@@ -1504,19 +1504,19 @@ await WaitForMultiple(2, partialDone =>
presence2.Subscribe(PresenceAction.Enter, msg =>
{
- presence2.MembersMap.Members.Should().HaveCount(presence2.IsSyncComplete ? 2 : 1);
+ presence2.MembersMap.Members.Should().HaveCount(presence2.SyncComplete ? 2 : 1);
presence2.Unsubscribe();
partialDone();
});
presence2.PendingPresenceQueue.Should().HaveCount(1);
- presence2.IsSyncComplete.Should().BeFalse();
+ presence2.SyncComplete.Should().BeFalse();
presence2.MembersMap.Members.Should().HaveCount(0);
taskCountWaiter.Tick();
});
var transport = client2.GetTestTransport();
- await new ConditionalAwaiter(() => presence2.IsSyncComplete);
+ await new ConditionalAwaiter(() => presence2.SyncComplete);
transport.ProtocolMessagesReceived.Any(m => m.Action == ProtocolMessage.MessageAction.Sync).
Should().BeTrue("Should receive sync message");
presence2.MembersMap.Members.Should().HaveCount(2);