Skip to content

subscription.close() does not flush pending acks. #2558

@lc-chrisbarton

Description

@lc-chrisbarton

#2380

The new api has made my code simpler so thanks. However I find that now there is no ACK which returns a promise then in a Cloud Function I have to write code like this i.e. the call to 'subscription.close()' does not flush the pending ACKs before resolving:

    return new Promise(
      function (resolve, reject) {
        messages.map(message => { message.ack() })
        subscription.close()
          .then(() => {
            setTimeout(function () {
              resolve()
            }, 3000)
          })
          .catch(err => reject(err))
      })

Metadata

Metadata

Assignees

Labels

api: pubsubIssues related to the Pub/Sub API.priority: p2Moderately-important priority. Fix may not be included in next release.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions