Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/@types/vscode.proposed.chatParticipantAdditions.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ declare module 'vscode' {
isComplete?: boolean;
toolSpecificData?: ChatTerminalToolInvocationData;
fromSubAgent?: boolean;
presentation?: 'hidden' | 'hiddenAfterComplete' | undefined;

constructor(toolName: string, toolCallId: string, isError?: boolean);
}
Expand Down
29 changes: 20 additions & 9 deletions src/view/pullRequestCommentController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { disposeAll } from '../common/lifecycle';
import Logger from '../common/logger';
import { ITelemetry } from '../common/telemetry';
import { fromPRUri, Schemes } from '../common/uri';
import { groupBy } from '../common/utils';
import { formatError, groupBy } from '../common/utils';
import { PULL_REQUEST_OVERVIEW_VIEW_TYPE } from '../common/webview';
import { FolderRepositoryManager } from '../github/folderRepositoryManager';
import { GitHubRepository } from '../github/githubRepository';
Expand Down Expand Up @@ -546,14 +546,25 @@ export class PullRequestCommentController extends CommentControllerBase implemen
return;
}

if (
comment.reactions &&
!comment.reactions.find(ret => ret.label === reaction.label && !!ret.authorHasReacted)
) {
// add reaction
await this.pullRequestModel.addCommentReaction(comment.rawComment.graphNodeId, reaction);
} else {
await this.pullRequestModel.deleteCommentReaction(comment.rawComment.graphNodeId, reaction);
try {
if (
comment.reactions &&
!comment.reactions.find(ret => ret.label === reaction.label && !!ret.authorHasReacted)
) {
// add reaction
await this.pullRequestModel.addCommentReaction(comment.rawComment.graphNodeId, reaction);
} else {
await this.pullRequestModel.deleteCommentReaction(comment.rawComment.graphNodeId, reaction);
}
} catch (e) {
// Ignore permission errors when removing reactions due to race conditions
// See: https://github.com/microsoft/vscode/issues/69321
const errorMessage = formatError(e);
if (errorMessage.includes('does not have the correct permissions to execute `RemoveReaction`')) {
// Silently ignore this error - it occurs when quickly toggling reactions
return;
}
throw new Error(errorMessage);
}
}

Expand Down
9 changes: 8 additions & 1 deletion src/view/reviewCommentController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -985,7 +985,14 @@ ${suggestionInformation.suggestionContent}
);
}
} catch (e) {
throw new Error(formatError(e));
// Ignore permission errors when removing reactions due to race conditions
// See: https://github.com/microsoft/vscode/issues/69321
const errorMessage = formatError(e);
if (errorMessage.includes('does not have the correct permissions to execute `RemoveReaction`')) {
// Silently ignore this error - it occurs when quickly toggling reactions
return;
}
throw new Error(errorMessage);
}
}

Expand Down