Skip to content

Commit

Permalink
Marked IsSyncInProgress as a public deprecated method
Browse files Browse the repository at this point in the history
  • Loading branch information
sacOO7 committed Apr 19, 2024
1 parent 8be657f commit 1ded60a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
18 changes: 12 additions & 6 deletions src/IO.Ably.Shared/Realtime/Presence.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,18 +43,24 @@ internal Presence(IConnectionManager connection, RealtimeChannel channel, string
/// </summary>
///
[Obsolete("This property is deprecated, use SyncComplete instead")]
public bool IsSyncComplete => SyncComplete; // RTP13
public bool IsSyncComplete => SyncComplete; // RTP13.

/// <summary>
/// Checks if presence sync has ended.
/// </summary>
///
public bool SyncComplete => MembersMap.SyncCompleted && !IsSyncInProgress; // RTP13
public bool SyncComplete => MembersMap.SyncCompleted && !SyncInProgress; // RTP13

/// <summary>
/// Indicates whether there is currently a sync in progress.
/// </summary>
internal bool IsSyncInProgress => MembersMap.SyncInProgress;
[Obsolete("This property is internal, will be removed in the future")]
public bool IsSyncInProgress => SyncInProgress;

/// <summary>
/// Indicates whether there is currently a sync in progress.
/// </summary>
internal bool SyncInProgress => MembersMap.SyncInProgress;

/// <summary>
/// Indicates all members present on the channel.
Expand Down Expand Up @@ -540,7 +546,7 @@ internal void OnSyncMessage(ProtocolMessage protocolMessage)
/* If a new sequence identifier is sent from Ably, then the client library
* must consider that to be the start of a new sync sequence
* and any previous in-flight sync should be discarded. (part of RTP18)*/
if (IsSyncInProgress && _currentSyncChannelSerial.IsNotEmpty() && _currentSyncChannelSerial != syncSequenceId)
if (SyncInProgress && _currentSyncChannelSerial.IsNotEmpty() && _currentSyncChannelSerial != syncSequenceId)
{
EndSync();
}
Expand Down Expand Up @@ -621,15 +627,15 @@ internal void OnPresence(PresenceMessage[] messages)

internal void StartSync()
{
if (!IsSyncInProgress)
if (!SyncInProgress)
{
MembersMap.StartSync();
}
}

private void EndSync()
{
if (!IsSyncInProgress)
if (!SyncInProgress)
{
return;
}
Expand Down
2 changes: 1 addition & 1 deletion src/IO.Ably.Tests.Shared/Rest/SandboxSpecExtension.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ internal static async Task WaitForAttachedState(this IRealtimeChannel channel, T
internal static async Task<bool> WaitSync(this Presence presence, TimeSpan? waitSpan = null)
{
TaskCompletionSource<bool> taskCompletionSource = new TaskCompletionSource<bool>();
var inProgress = presence.IsSyncInProgress;
var inProgress = presence.SyncInProgress;
if (inProgress == false)
{
return true;
Expand Down

0 comments on commit 1ded60a

Please sign in to comment.