Charge71 / botpress-webhook

Botpress module to create and manage webhooks to your bot
GNU General Public License v3.0
4 stars 6 forks source link

Can't create webhooks on production enviromment #2

Open rdricco opened 7 years ago

rdricco commented 7 years ago

I can create webhooks when running locally, this only happens on production enviromment (I'm running on a Heroku instance). Any idea?

error: Unhandled Rejection in Promise: Promise { _bitField: 18087936, _fulfillmentHandler0: { error: date/time field value out of range: "1499214418699" at Connection.parseE (/app/node_modules/pg/lib/connection.js:567:11) at Connection.parseMessage (/app/node_modules/pg/lib/connection.js:391:17) at Socket.<anonymous> (/app/node_modules/pg/lib/connection.js:129:22) at emitOne (events.js:115:13) at Socket.emit (events.js:210:7) at addChunk (_stream_readable.js:252:12) at readableAddChunk (_stream_readable.js:239:11) at Socket.Readable.push (_stream_readable.js:197:10) at TCP.onread (net.js:589:20) name: 'error', length: 168, severity: 'ERROR', code: '22008', detail: undefined, hint: 'Perhaps you need a different "datestyle" setting.', position: undefined, internalPosition: undefined, internalQuery: undefined, where: undefined, schema: undefined, table: undefined, column: undefined, dataType: undefined, constraint: undefined, file: 'datetime.c', line: '3887', routine: 'DateTimeParseError' }, _rejectionHandler0: undefined, _promise0: undefined, _receiver0: undefined } Reason:
slvnperron commented 7 years ago

@rdricco Looks like this community module was not updated to work with Postgres:

https://github.com/Charge71/botpress-webhook/blob/master/src/db.js#L50

This should instead be similar to: https://github.com/botpress/botpress-scheduler/blob/master/src/db.js#L91

Let me know if you can make this change :D