Skip to content
This repository was archived by the owner on Mar 17, 2026. It is now read-only.
This repository was archived by the owner on Mar 17, 2026. It is now read-only.

Topic.flush() returns immediately, before all items are published #1620

@feywind

Description

@feywind

Topic.flush() is promisified, so it returns either a Promise or takes a callback, depending on how it's called. This calls Publisher.flush(), which likewise can deal with Promises. However, MessageQueue.publish(), which Publisher.flush() calls, does not support Promises, only callbacks. But Publisher.flush() is expecting it to support Promises, so no callback is passed down, and Publisher.flush() gets back undefined, which passes through as a resolve, and no wait happens.

Metadata

Metadata

Assignees

Labels

api: pubsubIssues related to the googleapis/nodejs-pubsub API.priority: p2Moderately-important priority. Fix may not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions