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

Too many reviewers are requested (sometimes) when manually requesting reviewers #41

Open
James-Firth opened this issue Jan 16, 2019 · 1 comment
Labels
bug Something isn't working

Comments

@James-Firth
Copy link
Owner

James-Firth commented Jan 16, 2019

Potential Webhook Race Condition causes too many reviews to be requested.

The opened event sometimes has no users in it. This opened event causes two more request events to be be generated as Git Slackin requests X more reviews to hit the required number.


Reproduction

  • Click Open PR
  • Request reviews from 2 people (if 2 is the required number of reviewers for you)
  • Open PR

Git Slackin will receive 3 webhook events:

  • PR Opened
  • Review Requested 1
  • Review Requested 2

The PR Opened event will cause Git Slackin' to look for 2 random folks to review causing 2-4 (because it may overlap with the ones manually assigned) Reviewers to be requested.


Solution

This could be fixed by putting a setTimeout after receiving an opened PR event for a few seconds. Generally it looks like within 1 second all the events will come in, so call it 4 seconds to be safe?

I can use the PR as the unique identifier so we can cancel/reset the timeout if necessary.

This may be a good time to try implementing #31 as well?

@James-Firth James-Firth added the bug Something isn't working label Jan 16, 2019
@James-Firth
Copy link
Owner Author

May tie-in well with the Review Request revamp required for #38 and #25

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