Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Duplicate replies in thread when opening ticket shortly after replying #3

Open
p10e opened this issue Apr 27, 2020 · 0 comments
Open
Assignees
Labels
bug Something isn't working

Comments

@p10e
Copy link
Collaborator

p10e commented Apr 27, 2020

Slack continues to fire events until it receives a HTTP 2xx response, because it retries a few times after a failed attempt. As we currently ignore thread replies that are not part of an existing ticket, there is a chance that the "New reply" event interferes with "New ticket" creation, which already records the entire thread. This could lead to the following sequence:

  1. Agent adds reply to thread
  2. Slack fires "New reply" event, which we ignore as there is no ticket for the parent message
  3. Agent adds ticket reaction to open support ticket
  4. Slack fires "New reaction" event, which we check and validate before recording the entire thread
  5. Slack fires a delayed "New reply" event for the earlier failed attempt
  6. We now identify the reply as a valid reply to an existing ticket and add it to the thread
  7. The thread now has a duplicate reply

There are a few improvements to make here:

First of all, we should let Slack know we received the "New reply" event even if we don't handle it. That way, Slack will not consider it a failed attempt and will stop its cycle of retrying while backing off exponentially. Also, we will reduce the risk of this happening:

Maintain a response success rate of at least 5% of events per 60 minutes to prevent automatic disabling.

Secondly, we should probably respond more quickly to received events, as Slack employs a timeout of three seconds before it considers an event a failed attempt. Right now, we respond after processing the event.

Finally, we could make threads more robust by adding a timestamp check before adding a reply from a "New reply" event, so we ensure it doesn't interfere with new ticket creation having already added the relevant reply.

@p10e p10e added the bug Something isn't working label Apr 27, 2020
@p10e p10e self-assigned this Apr 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant