Schedule even more

This commit is contained in:
Dean Herbert 2023-12-20 19:42:05 +09:00
parent 856c59f7f7
commit 5284b95bb8
No known key found for this signature in database
1 changed files with 3 additions and 3 deletions

View File

@ -208,7 +208,7 @@ public override async Task BeginWatchingUserPresence()
Debug.Assert(connection != null);
await connection.InvokeAsync(nameof(IMetadataServer.BeginWatchingUserPresence)).ConfigureAwait(false);
isWatchingUserPresence.Value = true;
Schedule(() => isWatchingUserPresence.Value = true);
}
public override async Task EndWatchingUserPresence()
@ -218,14 +218,14 @@ public override async Task EndWatchingUserPresence()
if (connector?.IsConnected.Value != true)
throw new OperationCanceledException();
// must happen synchronously before any remote calls to avoid mis-ordering.
// must be scheduled before any remote calls to avoid mis-ordering.
Schedule(() => userStates.Clear());
Debug.Assert(connection != null);
await connection.InvokeAsync(nameof(IMetadataServer.EndWatchingUserPresence)).ConfigureAwait(false);
}
finally
{
isWatchingUserPresence.Value = false;
Schedule(() => isWatchingUserPresence.Value = false);
}
}