I've got an application built with Actions Builder with webhook handlers hosted on the firebase side. As an application has been migrated from old bundle AOG + Dialogflow, fulfillment webhook was exposed in the next way:
const functions = require('firebase-functions');
const passport = require('passport');
const express = require('express');
const bodyParser = require('body-parser');
const app = express();
const fulfillment = require('../fulfillment');
app.use(bodyParser.json());
app.post('/',
async function(request, response) {
await fulfillment(request, response);
});
exports.fulfillment = functions.https.onRequest(app);
Everything is working fine for both local and released production version, however, when Google team tries to reach a webhook endpoint, it throws a 500 error with a message: Handler not found for handle name. Full trace of an error is:
Error: Handler not found for handle name:
at Function.handler (/workspace/node_modules/@assistant/conversation/dist/conversation/conversation.js:139:23)
at standard (/workspace/node_modules/@assistant/conversation/dist/assistant.js:50:32)
at /workspace/node_modules/@assistant/conversation/dist/framework/express.js:29:13
at omni (/workspace/node_modules/@assistant/conversation/dist/assistant.js:39:53)
at /workspace/src/functions/fulfillment.function.js:29:13
at Layer.handle [as handle_request] (/workspace/node_modules/express/lib/router/layer.js:95:5)
at next (/workspace/node_modules/express/lib/router/route.js:137:13)
at Route.dispatch (/workspace/node_modules/express/lib/router/route.js:112:3)
at Layer.handle [as handle_request] (/workspace/node_modules/express/lib/router/layer.js:95:5)
at /workspace/node_modules/express/lib/router/index.js:281:22
Line 29 is await fulfillment, which is declared above, so it doesn't make a lot of sense. Have anybody else also experienced the same error, and how it can be solved? Any help appreciated.