Topic.flush() returns immediately, before all items are published #1620
Labels
api: pubsub
Issues related to the googleapis/nodejs-pubsub API.
priority: p2
Moderately-important priority. Fix may not be included in next release.
type: bug
Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Topic.flush()
is promisified, so it returns either a Promise or takes a callback, depending on how it's called. This callsPublisher.flush()
, which likewise can deal with Promises. However,MessageQueue.publish()
, whichPublisher.flush()
calls, does not support Promises, only callbacks. ButPublisher.flush()
is expecting it to support Promises, so no callback is passed down, andPublisher.flush()
gets back undefined, which passes through as a resolve, and no wait happens.The text was updated successfully, but these errors were encountered: