Skip to content

Commit

Permalink
Rollback cl/601489921, in windows, discovery phase won't be recorded …
Browse files Browse the repository at this point in the history
…due to pointer is reset to null.

PiperOrigin-RevId: 722461978
  • Loading branch information
edwinwugoog authored and copybara-github committed Feb 3, 2025
1 parent 17c6dd8 commit a938727
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 3 additions & 1 deletion connections/implementation/client_proxy.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1083,7 +1083,9 @@ void ClientProxy::RemoveAllEndpoints() {

void ClientProxy::OnSessionComplete() {
MutexLock lock(&mutex_);
if (connections_.empty() && !IsAdvertising()) {
// TODO(b/391339677): Revert back to the original logic first. Need to further
// check how to log session when discovery is on.
if (connections_.empty() && !IsAdvertising() && !IsDiscovering()) {
local_endpoint_id_.clear();

analytics_recorder_->LogSession();
Expand Down
4 changes: 1 addition & 3 deletions connections/implementation/client_proxy_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1360,9 +1360,7 @@ TEST_F(ClientProxyTest,
// After
OnDiscoveryConnectionDisconnected(client2(), advertising_endpoint);
client2()->GetAnalyticsRecorder().Sync();
// Since we are no longer checking IsDiscovering(), we complete sessions now
// solely based on advertising.
EXPECT_EQ(event_logger2_.GetCompleteClientSessionCount(), 1);
EXPECT_EQ(event_logger2_.GetCompleteClientSessionCount(), 0);
}

TEST_F(ClientProxyTest, LogSessionForResetClientProxy) {
Expand Down

0 comments on commit a938727

Please sign in to comment.