Skip to content

Message accepted on broken payload (invalid JSON) #1809

Description

@ryansiau

Sending an invalid JSON payload on incoming webhooks (haven't tested outgoing yet) creates an event that does not show on both "Event Deliveries" and "Events Log" page. However, there are some logs related to the event

{
    "error": "unexpected end of JSON input",
    "level": "error",
    "msg": "error find a matching subscription for this source",
    "time": "2023-10-20 10:55:18"
}

Reproduce

This is persistent and can be reproduced easily. for context, i used docker-compose to deploy the instance

  1. create a project for incoming webhook
  2. create a source, endpoint, and corresponding subscription
  3. send any invalid json as payload, for example like this:
{
  "data": ""

after sending the request, the terminal will be filled with error logs similar to these

{"error":"unexpected end of JSON input","level":"error","msg":"error find a matching subscription for this source","time":"2023-10-20 11:15:27"}
{"error":"error find a matching subscription for this source","job":"CreateEventProcessor","level":"error","msg":"job failed","source":"worker","time":"2023-10-20 11:15:27"}

Discussion

I'm wondering if we can avoid this error by adding a payload validator or adding support for custom middleware?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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