Skip to content

pubsub.getTopics() returns topics that throw error on topic.delete() #1005

Description

@chrishiestand

This is a problem in [email protected] and 0.25.0; v0.24.1 does not reproduce the problem. Tested with node v4 LTS.

The problem is that topics returned by pubsub.getTopics() are somehow constructed differently than pubsub.createTopic() - in that eventually the former uses an invalid url when topic.delete() is called.

It tries to send an api request to e.g. path: /v1/projects/projectname/topics/projects/projectname/topics/delme_704317

note the duplicated path portions.

See this for a reproducible test project:
https://github.com/chrishiestand/gcloud-node-pubsub-topic-bug

to reproduce:
just git clone, npm install, export GCLOUD_PROJECT=$project, and node index.js

Activity

  1. jgeewax commented on Dec 8, 2015

    @jgeewax
    Contributor

    Thanks for the super thorough report :) This is awesome. /cc @stephenplusplus

  2. stephenplusplus commented on Dec 8, 2015

    @stephenplusplus
    Contributor

    Great report, indeed! Sorry you ran into this. I'll look it over in a little bit and try to squash it for good and put out a patch release.

  3. added
    type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.
    api: pubsubIssues related to the Pub/Sub API.
    on Dec 8, 2015
  4. stephenplusplus commented on Dec 8, 2015

    @stephenplusplus
    Contributor

    PR sent in #1008.

  5. chrishiestand commented on Dec 9, 2015

    @chrishiestand
    ContributorAuthor

    Thanks for the quick turnaround!

  6. added a commit that references this issue on Mar 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

api: pubsubIssues related to the Pub/Sub API.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