Skip to content

waitForComplete + transformation function returns HTTP error #1251

@yncyrydybyl

Description

@yncyrydybyl

Generic webhooks return {"ok":false,"error":"Failed to process webhook"} when both waitForComplete and a transformation function are enabled. The message posts to the room fine, but the HTTP caller gets an error.

Each works independently — only the combination breaks.

Cause: When the transformation's execute() throws, onGenericHook sets successful = false but still delivers a fallback message. Without waitForComplete the caller gets HTTP 202 (successful: null path). With waitForComplete, the false reaches the Router and returns HTTP 500. This also makes webhookResponse (#839) unusable since it requires waitForComplete.

A secondary issue: if onGenericHook throws with waitForComplete on, Bridge.ts never queues a response — the caller gets a generic error with no details.

Fix branch: https://github.com/yncyrydybyl/matrix-hookshot/tree/yncyrydybyl/fix-waitforcomplete-transformation

Related: #247, #839

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions