fix(reactions): remove eye emoji before adding thumbs-up reaction #506
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes #505
Applied changes based on Issue #505.
I’ve added support so that whenever the bot gives a thumbs‑up reaction it first clears its “eyes” reaction on that same event—covering issues, issue‑comments and pull‑request review comments—and I’ve added a unit test suite to lock in that behavior.
Changes in
src/github/reactions.ts
removeEyeReaction
to also handle pull‐request review comments by callinglistForPullRequestReviewComment
/deleteForPullRequestReviewComment
.removeEyeReaction
insideaddThumbUpReaction
.【F:src/github/reactions.ts†L102-L124】【F:src/github/reactions.ts†L147-L150】
New tests in
__tests__/unit/github/reactions.test.ts
A dedicated test suite now verifies that for each event type (issue, issue‑comment and PR review‑comment), the eyes reaction is removed before a thumbs‑up is applied.
【F:tests/unit/github/reactions.test.ts†new】
With these changes, adding a thumbs‑up on any issue, issue‑comment, or PR‑review‑comment will properly first remove the bot’s “eyes” reaction.