mirror of
https://github.com/kidfromjupiter/nearby.git
synced 2026-09-14 14:46:12 -04:00
Do not download public certs after pairing until BE support query by join time.
PiperOrigin-RevId: 952386990
This commit is contained in:
committed by
Copybara-Service
parent
6e092fdd53
commit
e1a2316c9e
@@ -657,6 +657,7 @@ cc_test(
|
||||
":transfer_metadata",
|
||||
":transfer_metadata_matchers",
|
||||
":types",
|
||||
"//google/protobuf:timestamp_cc_proto",
|
||||
"//internal/base:file_path",
|
||||
"//internal/base:files",
|
||||
"//internal/flags:nearby_flags",
|
||||
|
||||
@@ -2860,8 +2860,14 @@ void NearbySharingServiceImpl::OnPeerSyncBindingComplete(
|
||||
kJoinBindingTimeLifeTime);
|
||||
}
|
||||
}
|
||||
// Download public certificates again to update the newly added sync binding.
|
||||
certificate_manager_->DownloadPublicCertificates();
|
||||
// TODO: Remove this check after BE supports cert download without join time.
|
||||
// Without join time, the new download can overwrite the bindings we added
|
||||
// from the binding response.
|
||||
if (binding_response.has_join_binding_time()) {
|
||||
// Download public certificates again to update the newly added sync
|
||||
// binding.
|
||||
certificate_manager_->DownloadPublicCertificates();
|
||||
}
|
||||
}
|
||||
|
||||
void NearbySharingServiceImpl::OnReceivedIntroduction(
|
||||
|
||||
@@ -30,6 +30,7 @@
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
#include "google/protobuf/timestamp.pb.h"
|
||||
#include "location/nearby/analytics/cpp/logging/mock_event_logger.h"
|
||||
#include "location/nearby/sharing/lib/account/fake_account_manager.h"
|
||||
#include "location/nearby/sharing/lib/account/mock_account_observer.h"
|
||||
@@ -5235,10 +5236,11 @@ TEST_F(NearbySharingServiceImplTest, InitiatePairingSuccess) {
|
||||
binding_response_frame.set_version(Frame::V1);
|
||||
binding_response_frame.mutable_v1()->set_type(
|
||||
service::proto::V1Frame::BINDINGS);
|
||||
binding_response_frame.mutable_v1()
|
||||
auto* binding_response = binding_response_frame.mutable_v1()
|
||||
->mutable_bindings()
|
||||
->mutable_binding_response()
|
||||
->set_status(service::proto::BindingResponse::SUCCESS);
|
||||
->mutable_binding_response();
|
||||
binding_response->set_status(service::proto::BindingResponse::SUCCESS);
|
||||
binding_response->mutable_join_binding_time()->set_seconds(1234567890);
|
||||
std::vector<uint8_t> result_bytes(binding_response_frame.ByteSizeLong());
|
||||
binding_response_frame.SerializeToArray(result_bytes.data(),
|
||||
result_bytes.size());
|
||||
|
||||
Reference in New Issue
Block a user