Don't check IsDiscovering() when going to rotate endpoint ID

PiperOrigin-RevId: 601489921
This commit is contained in:
Anay Wadhera
2024-01-25 10:30:23 -08:00
committed by Copybara-Service
parent f112d9ff71
commit d1a6913017
2 changed files with 4 additions and 2 deletions
+1 -1
View File
@@ -982,7 +982,7 @@ void ClientProxy::RemoveAllEndpoints() {
void ClientProxy::OnSessionComplete() {
MutexLock lock(&mutex_);
if (connections_.empty() && !IsAdvertising() && !IsDiscovering()) {
if (connections_.empty() && !IsAdvertising()) {
local_endpoint_id_.clear();
analytics_recorder_->LogSession();
@@ -991,7 +991,9 @@ TEST_F(ClientProxyTest,
// After
OnDiscoveryConnectionDisconnected(&client2_, advertising_endpoint);
client2_.GetAnalyticsRecorder().Sync();
EXPECT_EQ(event_logger2_.GetCompleteClientSessionCount(), 0);
// Since we are no longer checking IsDiscovering(), we complete sessions now
// solely based on advertising.
EXPECT_EQ(event_logger2_.GetCompleteClientSessionCount(), 1);
}
TEST_F(ClientProxyTest, LogSessionForResetClientProxy) {