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

Closing and re-opening a pull request causes double/triple commenting. #151

Closed
groovecoder opened this issue Aug 22, 2015 · 4 comments
Closed
Labels

Comments

@groovecoder
Copy link
Owner

STR:

  1. Create a PR with the hook enabled
  2. Close the PR
  3. Re-open the PR

Expected results:
Only opening a PR should add a comment

Actual results:
Closing the PR created another batch of line-by-line comments

Example:
groovecoder/discord-test#1

@openjck
Copy link
Contributor

openjck commented Aug 22, 2015

Thanks for the detailed STR! This might be related to #79.

@Faeranne
Copy link
Contributor

opening and creating a PR both initiate the same API Action. We need to be tracking comments to fix this properly. I assume fixing #79 should make this issue go away, even though they are technically different issues. Going to leave this issue open in-case the fix is not enough.

@groovecoder
Copy link
Owner Author

@openjck and I thought a solution may be:

  1. Create a comments table in our shiny new postgres database
  2. Update the comment code to store a hash of the url, file name, line number, and line contents
  3. Before making a comment, make sure there isn't already a comment record with the same hash

That file name, line number, and line contents combination seems to be the same keys that GitHub uses to decide whether to collapse comments in the PR interface. But we can tweak the hash components as needed.

@openjck
Copy link
Contributor

openjck commented Dec 31, 2015

It sounds like this issue and #79 share the same underlying cause. We should never post the same comment twice. I'll update the language of #79 to be more general and call this a duplicate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants