Using the Google Ads API, if you call search() on a GoogleAdsServiceClient where the GoogleAdsServiceClient has a LoginCustomerId set one that does not have access to the CustomerId used in the search query, then instead of erroring it appears the query never returns.
In Google Ads API version 2 this would error with an unauthorised GoogleAdsException, in the latest version it just hangs. Is this a bug?
GoogleAdsClient googleAdsClient = GoogleAdsClient
.newBuilder()
.setLoginCustomerId(managerAccountId)
.setDeveloperToken(getDeveloperToken())
.setCredentials(getCredentials())
.setEnableGeneratedCatalog(false)
.build();
String query = "SELECT customer_client.resource_name FROM customer_client LIMIT 1";
SearchGoogleAdsRequest request = SearchGoogleAdsRequest
.newBuilder()
.setCustomerId(Long.toString(childAccountId))
.setPageSize(1)
.setQuery(query)
.build();
try (GoogleAdsServiceClient googleAdsServiceClient = googleAdsClient.getLatestVersion().createGoogleAdsServiceClient()) {
googleAdsServiceClient.search(request);
}