Skip to content

Suppress RemoveReaction permission errors during rapid reaction toggling#8225

Merged
alexr00 merged 5 commits intomainfrom
copilot/fix-graphql-reaction-error
Dec 11, 2025
Merged

Suppress RemoveReaction permission errors during rapid reaction toggling#8225
alexr00 merged 5 commits intomainfrom
copilot/fix-graphql-reaction-error

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Dec 9, 2025

Race condition when rapidly toggling reactions causes permission errors as the client attempts to remove reactions that don't belong to the user or are already removed server-side.

Changes

  • Error suppression in toggleReaction: Catch and silently ignore RemoveReaction permission errors in both reviewCommentController.ts and pullRequestCommentController.ts
  • Pattern matching: Check error message for 'does not have the correct permissions to execute \'RemoveReaction\'' (consistent with existing GraphQL error handling throughout the codebase)
  • Consistent error handling: Use formatError() and re-wrap in both implementations
try {
  // add or remove reaction
} catch (e) {
  const errorMessage = formatError(e);
  if (errorMessage.includes('does not have the correct permissions to execute \'RemoveReaction\'')) {
    return; // Silently ignore race condition
  }
  throw new Error(errorMessage);
}

All other errors remain unhandled to preserve existing behavior.

Original prompt

This section details on the original issue you should resolve

<issue_title>GraphQL error while quickly adding and removing reaction</issue_title>
<issue_description>microsoft/vscode#69321

Repo

  1. open a PR with reaction comments
  2. Quickly click multiple times on an existing reaction that someone else has added

Bug
See the error: Deleting the comment reaction failed: GraphQL error: mjbvz does not have the correct permissions to execute 'RemoveReaction'

</issue_description>

<agent_instructions>Just ignore this specific error.</agent_instructions>

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 3 commits December 9, 2025 10:23
Co-authored-by: alexr00 <38270282+alexr00@users.noreply.github.com>
When users quickly click on a reaction to add/remove it, a race condition
can occur where the client tries to remove a reaction that the user doesn't
have permission to remove. This results in a GraphQL error:
"does not have the correct permissions to execute 'RemoveReaction'"

This change silently ignores this specific error as it's expected behavior
during rapid toggling of reactions.

Fixes microsoft/vscode#69321

Co-authored-by: alexr00 <38270282+alexr00@users.noreply.github.com>
…entations

- Import formatError in pullRequestCommentController.ts
- Use formatError(e) consistently in both implementations
- Throw new Error(errorMessage) consistently instead of rethrowing original error

Co-authored-by: alexr00 <38270282+alexr00@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix GraphQL error when adding and removing reactions Suppress RemoveReaction permission errors during rapid reaction toggling Dec 9, 2025
Copilot AI requested a review from alexr00 December 9, 2025 10:34
@alexr00 alexr00 marked this pull request as ready for review December 11, 2025 14:25
@alexr00 alexr00 enabled auto-merge (squash) December 11, 2025 14:25
@vs-code-engineering vs-code-engineering Bot added this to the December / January 2026 milestone Dec 11, 2025
@alexr00 alexr00 merged commit adba5c4 into main Dec 11, 2025
6 checks passed
@alexr00 alexr00 deleted the copilot/fix-graphql-reaction-error branch December 11, 2025 14:52
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.

GraphQL error while quickly adding and removing reaction

3 participants