Skip to content

Conversation

@MoChilia
Copy link
Member

@MoChilia MoChilia commented Oct 16, 2025

Editing a PR in a short time after opening it may cause the reply to be sent twice. We should check the reply status again before adding comments.
Test: https://github.com/MoChilia/ActionDemo/actions/runs/18551769709/job/52880444318

@MoChilia MoChilia self-assigned this Oct 16, 2025
@MoChilia MoChilia requested a review from Copilot October 16, 2025 05:55
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Adds a secondary reply-status check prior to applying labels and posting a comment to avoid duplications.

  • Introduces an additional POST to verify reply status.
  • Early return prevents duplicate labels/comments when already replied.

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

message += PoweredBy;

// Check reply status again before adding labels and comments to prevent duplicate labels and comments
const if_replied_again: boolean = (await axios.post(botUrl + '/check_reply/', {
Copy link

Copilot AI Oct 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] Explicit type annotation : boolean is redundant; TypeScript can infer the boolean type from (await ...).data.result. Removing it reduces noise without loss of safety.

Suggested change
const if_replied_again: boolean = (await axios.post(botUrl + '/check_reply/', {
const if_replied_again = (await axios.post(botUrl + '/check_reply/', {

Copilot uses AI. Check for mistakes.
@MoChilia MoChilia requested a review from bebound October 16, 2025 06:00
@MoChilia MoChilia merged commit 2c9e76d into Azure:main Oct 16, 2025
1 check passed
@MoChilia MoChilia deleted the check-comment branch October 16, 2025 07:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants