Skip to content

fix(enforce-single-assignee): fetch live assignees and sleep before acting#53

Merged
drewr merged 1 commit intomainfrom
fix-enforce-single-assignee
Mar 7, 2026
Merged

fix(enforce-single-assignee): fetch live assignees and sleep before acting#53
drewr merged 1 commit intomainfrom
fix-enforce-single-assignee

Conversation

@drewr
Copy link
Copy Markdown
Contributor

@drewr drewr commented Mar 6, 2026

Summary

Two fixes to address duplicate comments and stale event data. Hate fixing concurrency issues with sleeps but github only gives us so many tools here.

Problems

Latest from #50 is that we still didn't get one comment-per-assignment-activity AND the timeline has a confusing message that only includes one of the assignees:

  1. Stale event payload: github.event.issue.assignees is frozen at trigger time. When a queued run executes after the first run has already cleaned up, it still sees the original assignee list and posts a duplicate comment.

  2. All assignments not yet visible: The first run could fire before GitHub has finished processing all simultaneous assignments, so the timeline wouldn't show all assignees before removal.

Fixes

  • sleep 3 at the start of the step gives GitHub time to process all simultaneous assignments, so all are visible in the issue timeline before any are removed.
  • Live API fetch replaces the frozen event payload — queued runs now see the post-cleanup state (0 assignees) and exit early with no comment.

Result

Assigning 4 people simultaneously now:

  1. All 4 appear as assigned in the timeline
  2. One run removes all 4 and posts exactly one comment
  3. The queued run sees 0 assignees and exits silently

…cting

- Sleep 3s before fetching so all simultaneous assignments are visible
  in the issue timeline before any are removed
- Fetch current assignees live from the API instead of using the frozen
  event payload, so queued runs see the post-cleanup state and exit early

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@drewr drewr self-assigned this Mar 6, 2026
@drewr drewr merged commit 2690ed5 into main Mar 7, 2026
3 checks passed
@drewr drewr deleted the fix-enforce-single-assignee branch March 7, 2026 16:43
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.

1 participant