-
Notifications
You must be signed in to change notification settings - Fork 237
Closed
Labels
api: pubsubIssues related to the googleapis/nodejs-pubsub API.Issues related to the googleapis/nodejs-pubsub API.priority: p2Moderately-important priority. Fix may not be included in next release.Moderately-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.Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Description
Environment details
- OS: Mac OS 13.1
- Node.js version: 18.13.0
- npm version: 8.19.3
@google-cloud/pubsubversion: 3.2.1
Steps to reproduce
- Use the
createTopicfunction on a PubSub Client - The returned value (CreateTopicResponse) contain the created Topic but the topic.name value don't have the
{{projectId}}rendered.
Exemple :
- I use in local env. the PubSub Emulator (exposed at
localhost:8085) {{projectId}}=julienperrault
import {
PubSub,
} from '@google-cloud/pubsub'
const client = new PubSub()
const main = async () => {
const topicName = "test-topic"
const createdTopic = await client
.createTopic(topicName)
.then(([topic]) => topic)
.catch(err => {
if (err.code === 6) {
return client.topic(topicName)
}
return err
}
)
console.log(createdTopic.name)
const foundTopic = await client.topic(topicName)
console.log(foundTopic.name)
}
main()Console :
- Compile (
npx tsc) - Run (
npm run startlaunchPUBSUB_EMULATOR_HOST=${PUBSUB_EMULATOR_HOST:-localhost:8085} node index.js)
npm run start
> start
> PUBSUB_EMULATOR_HOST=${PUBSUB_EMULATOR_HOST:-localhost:8085} node index.js
projects/{{projectId}}/topics/test-topic
projects/julienperrault/topics/test-topicReactions are currently unavailable
Metadata
Metadata
Assignees
Labels
api: pubsubIssues related to the googleapis/nodejs-pubsub API.Issues related to the googleapis/nodejs-pubsub API.priority: p2Moderately-important priority. Fix may not be included in next release.Moderately-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.Error or flaw in code with unintended results or allowing sub-optimal usage patterns.