I am testing out publishTime and it seems to not be present, at least while using the simulator. The nanos field is 0 which makes this check return false: https://github.com/GoogleCloudPlatform/google-cloud-node/blob/master/packages/pubsub/src/subscription.js#L367
Thanks for the report! This should do:
- if (publishTime.seconds && publishTime.nanos) {
+ if (is.number(publishTime.seconds) && is.number(publishTime.nanos)) {
Thanks- should I make a PR?
It's hard to say no to that! 馃憤
I also don't see publishTime from pubsub messages from the emulator. The docs also don't seem to show the publishTime field: https://cloud.google.com/pubsub/docs/emulator#using_the_emulator
{
"messages": [
{
"subscription": "projects/PUBSUB_PROJECT_ID/subscriptions/SUBSCRIPTION_ID",
"message": {
"data": "TWVzc2FnZSBudW1iZXIgMQ==",
"messageId": "10",
"attributes": {}
},
"id": 1
},
...
]
}
I know this is an old issue so let me know if I should create a new issue.
Most helpful comment
I also don't see publishTime from pubsub messages from the emulator. The docs also don't seem to show the publishTime field: https://cloud.google.com/pubsub/docs/emulator#using_the_emulator
I know this is an old issue so let me know if I should create a new issue.