Skip to content

Request hangs indefinitely on activities without handlers defined #393

@wpp-vlad-ardelean

Description

@wpp-vlad-ardelean

How to reproduce:

const app = new App({
    skipAuth: true,  // not needed, just for easier local testing
});

app.on("message", async ({ send }) => {
    await send("Hello there!");
});
app.start();

With the above setup, activities of type message will be handled as expected by the handler we defined via app.on. However, for any other kind of activity (like, for example, installationUpdate) the request will hang indefinitely.
I believe the cause is here:

if (routes.length === 0) {
return { status: 200 };
}

By exiting process early, there's never a chance for onActivityResponse to be called here:
this.onActivityResponse(sender, {
...ref,
sender,
activity,
response: res,
});

And without onActivityResponse being called, the HttpPlugin never sends a response, leading the request to hang indefinitely, which I don't think was desired.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions