RocketChat / RocketChat/Rocket.Chat

Integration will Retry Outgoing Webhook even if status is 200

Open
#25,562 4 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
46.1k
Forks
13.9k
Avg merge
3d 3h
Merged PRs (30d)
130

Description

Description:

When turning on Webhook retry, the Integration will send retry attempts even if the first response was 200 / empty.

CleanShot 2022-05-19 at 09 21 40@2x

I see that the logs have received an empty response. It is not logged which status code it has received.

CleanShot 2022-05-19 at 09 22 10@2x

However in my own app, the signal was received and processed correctly, returned with status 200.

CleanShot 2022-05-19 at 09 23 10@2x
Steps to reproduce:
  1. Create an outgoing webhook on new message
  2. Turn on Retry logic
  3. On the webhook recipient, process the request as follows (this example uses Django)
def new_message(request):
    TOKEN = "XYXYXY"
    body = request.body.decode('utf8')
    data = json.loads(body)
    if data['token'] != TOKEN:
        return HttpResponse(status=403)

    # do some stuff

    return HttpResponse(status=200)
  1. See that the "stuff" is being done, but request is still retried
Expected behavior:

There should be no further retries after receiving a non-error response.

Actual behavior:

Request is retried three times.

Server Setup Information:

Docker

CleanShot 2022-04-15 at 11 34 32@2x
Client Setup Information

Desktop App or Browser Version: Browser, Chrome 99

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the outgoing webhook flow with retry logic enabled and a recipient that returns HTTP 200 with an empty response. Trace the handling of the response status and retry decision. Done means a non-error response produces no further retries and the observed status is logged.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
api, backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.