Skip to content

Commit cb8d090

Browse files
author
Tulga Tsogtgerel
committed
fix: add reaction immediately for quick user feedback
Move the reaction step to happen right after Octokit initialization, before any other processing or API calls. This ensures users get immediate visual feedback that their comment is being processed.
1 parent 0388a20 commit cb8d090

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

assistant/src/index.ts

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -434,17 +434,18 @@ async function main(): Promise<void> {
434434
const reaction = validateReaction(reactionInput);
435435
const { owner, repo } = parseRepository();
436436

437-
core.info(`🎯 Starting PR Assistant for comment ${commentId}`);
438-
core.info(`📦 Repository: ${owner}/${repo}`);
439-
core.info(`📝 Event: ${eventName}`);
440-
441437
// Create Octokit instance
442438
const octokit = new Octokit({ auth: githubToken });
443439

444-
// Step 1: Add reaction to show we're processing
445-
core.info('👀 Adding reaction to comment...');
440+
// Step 1: Add reaction IMMEDIATELY to give user quick feedback
441+
core.info('👀 Adding reaction to comment for quick feedback...');
446442
await addReaction(octokit, owner, repo, commentId, eventName, reaction);
447443

444+
// Now start the actual processing
445+
core.info(`🎯 Starting PR Assistant for comment ${commentId}`);
446+
core.info(`📦 Repository: ${owner}/${repo}`);
447+
core.info(`📝 Event: ${eventName}`);
448+
448449
// Step 2: Get PR number
449450
core.info('🔍 Finding associated PR...');
450451
const prNumber = await getPRNumber(octokit, owner, repo, commentId, eventName);

0 commit comments

Comments
 (0)