-
Notifications
You must be signed in to change notification settings - Fork 169
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
When Pubsub notifications are sent to a locally hosted cloud event function, the first argument is undefined. It should contain the event information. The 2nd argument though present, does not match production signature; rather than containing metadata about the notification, it contains the entire event object, which should be the contents of argument 1 instead.
My dummy cloud events function:
exports.helloEvents = (data, context) => {
console.log(data);
console.log(context);
};
Pub/sub notification being sent:
{
"subscription": "projects/myproj/subscriptions/mysub",
"message": {
"data": "...my base 64 encoded data...",
"messageId": "1",
"attributes": {}
}
}
helloEvents log in production:
Argument 1, data, is:
{
"subscription":"projects/myproj/subscriptions/mysub",
"message":{
"data":"...my base 64 encoded data...",
"messageId":"1",
"attributes":{}
}
}
Argument 2, context, is:
{
"eventId":"12032d95-089a-4663-9be5-8aafd9d4c623",
"resource":{
"service":"pubsub.googleapis.com",
"name":"projects/myproj/topics/mytopic"
},
"eventType":"google.pubsub.topic.publish",
"timestamp":"2019-06-16T18:39:44.809Z"
}
On local, the results I get is very different.
- Argument 1: undefined
- Argument 2:
{
"subscription":"projects/myproj/subscriptions/mysub",
"message":{
"data":"...my base 64 encoded data...",
"messageId":"1",
"attributes":{}
}
}
nodeful, GitTom, ferparra, 27Bslash6, m0ar and 8 more
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working