diff --git a/CHANGELOG.md b/CHANGELOG.md index 69d77509e3b94..76f2e219dd247 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -95,7 +95,10 @@ For status on this, see https://github.com/googleapis/google-cloud-cpp/issues/88 details. -## v2.1.0 - TBD +## v2.0.1 - 2022-07 + +* fix(pubsub): missing subscription name in lease extensions. + This made the lease extensions fail in all cases. ## v2.0.0 - 2022-07 diff --git a/google/cloud/pubsub/internal/streaming_subscription_batch_source.cc b/google/cloud/pubsub/internal/streaming_subscription_batch_source.cc index de3c4c337d85b..25025b1fc47b1 100644 --- a/google/cloud/pubsub/internal/streaming_subscription_batch_source.cc +++ b/google/cloud/pubsub/internal/streaming_subscription_batch_source.cc @@ -127,6 +127,7 @@ future StreamingSubscriptionBatchSource::BulkNack( void StreamingSubscriptionBatchSource::ExtendLeases( std::vector ack_ids, std::chrono::seconds extension) { google::pubsub::v1::ModifyAckDeadlineRequest request; + request.set_subscription(subscription_full_name_); request.set_ack_deadline_seconds( static_cast(extension.count())); for (auto& a : ack_ids) { diff --git a/google/cloud/pubsub/internal/streaming_subscription_batch_source_test.cc b/google/cloud/pubsub/internal/streaming_subscription_batch_source_test.cc index 7d6533764b7bf..1c9122eec8501 100644 --- a/google/cloud/pubsub/internal/streaming_subscription_batch_source_test.cc +++ b/google/cloud/pubsub/internal/streaming_subscription_batch_source_test.cc @@ -522,17 +522,25 @@ TEST(StreamingSubscriptionBatchSourceTest, AckMany) { Property(&ModifyRequest::ack_ids, ElementsAre("fake-003")))) .WillOnce(OnModify); - EXPECT_CALL(*mock, AsyncModifyAckDeadline( - _, _, - Property(&ModifyRequest::ack_ids, - ElementsAre("fake-004", "fake-005")))) + EXPECT_CALL( + *mock, + AsyncModifyAckDeadline( + _, _, + AllOf( + Property(&ModifyRequest::subscription, + "projects/test-project/subscriptions/test-subscription"), + Property(&ModifyRequest::ack_ids, + ElementsAre("fake-004", "fake-005"))))) .WillOnce(OnModify); EXPECT_CALL( *mock, AsyncModifyAckDeadline( _, _, - AllOf(Property(&ModifyRequest::ack_ids, ElementsAre("fake-006")), - Property(&ModifyRequest::ack_deadline_seconds, 123)))) + AllOf( + Property(&ModifyRequest::subscription, + "projects/test-project/subscriptions/test-subscription"), + Property(&ModifyRequest::ack_ids, ElementsAre("fake-006")), + Property(&ModifyRequest::ack_deadline_seconds, 123)))) .WillOnce(OnModify); auto shutdown = std::make_shared();