Quellcode durchsuchen

fix: improve job deduplication key to include action and assignee #19

Previously, the deduplication key was just `issue-{number}`, which blocked
legitimate state changes within 5 minutes. For example:
1. Issue created (no assignee) → sets timestamp for `issue-21`
2. Issue assigned to Claude 2 minutes later → BLOCKED

Now the key is `issue-{number}-{action}-{assignee}`, which:
- Prevents true duplicates (same issue, action, and assignee)
- Allows legitimate state changes (assignment, reopening, etc.)
- Fixes the bug where assigning an issue to Claude shortly after
  creation would be blocked with "Skipping duplicate job"

Related to issue #16 (job deduplication implementation)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Claude vor 9 Monaten
Ursprung
Commit
f1918c1bbc
1 geänderte Dateien mit 6 neuen und 1 gelöschten Zeilen
  1. 6 1
      src/jobQueue.js

+ 6 - 1
src/jobQueue.js

@@ -86,7 +86,12 @@ export class JobQueue {
     if (eventType === 'issues' || eventType === 'issue_comment') {
       const issueNumber = payload.issue?.number;
       if (issueNumber) {
-        const key = `issue-${issueNumber}`;
+        // Create a more specific key that includes action and assignee
+        // This prevents blocking legitimate state changes (e.g., assignment after creation)
+        const action = payload.action || 'unknown';
+        const assignee = payload.issue?.assignee?.username || 'none';
+        const key = `issue-${issueNumber}-${action}-${assignee}`;
+
         const lastProcessed = this.recentlyProcessed.get(key);
         const now = Date.now();