Skip to content

Commit 2a8e074

Browse files
Copilotalexr00
andcommitted
Add comments explaining why currentUser is not passed for changed threads
Co-authored-by: alexr00 <38270282+alexr00@users.noreply.github.com>
1 parent 286849c commit 2a8e074

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

src/view/pullRequestCommentController.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,7 @@ export class PullRequestCommentController extends CommentControllerBase implemen
286286
const index = this._commentThreadCache[key] ? this._commentThreadCache[key].findIndex(t => t.gitHubThreadId === thread.id) : -1;
287287
if (index > -1) {
288288
const matchingThread = this._commentThreadCache[key][index];
289+
// Don't pass currentUser for changed threads - the "just created" logic should only apply to newly created threads
289290
updateThread(this._context, matchingThread, thread, this._githubRepositories);
290291
}
291292
}

src/view/reviewCommentController.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -331,6 +331,7 @@ export class ReviewCommentController extends CommentControllerBase implements Co
331331
const match = this._findMatchingThread(thread);
332332
if (match.index > -1) {
333333
const matchingThread = match.threadMap[thread.path][match.index];
334+
// Don't pass currentUser for changed threads - the "just created" logic should only apply to newly created threads
334335
updateThread(this._context, matchingThread, thread, githubRepositories);
335336
}
336337
}
@@ -419,6 +420,7 @@ export class ReviewCommentController extends CommentControllerBase implements Co
419420
const commentThreads = threads[path];
420421
for (const commentThread of commentThreads) {
421422
const reviewThread = reviewThreadsForPath.get(commentThread.gitHubThreadId)!;
423+
// Don't pass currentUser for refreshed threads - the "just created" logic should only apply to newly created threads
422424
updateThread(this._context, commentThread, reviewThread, githubRepositories, expand);
423425
}
424426
}

0 commit comments

Comments
 (0)