Skip to content

fix(mirror): guard ISSUE_CLOSURE solved_by_pr write when issue was reopened#200

Open
andriypolanski wants to merge 1 commit into
entrius:testfrom
andriypolanski:fix/iss-closure-race-solved-by-pr
Open

fix(mirror): guard ISSUE_CLOSURE solved_by_pr write when issue was reopened#200
andriypolanski wants to merge 1 commit into
entrius:testfrom
andriypolanski:fix/iss-closure-race-solved-by-pr

Conversation

@andriypolanski

Copy link
Copy Markdown

Summary

  • Guard ISSUE_CLOSURE writes with WHERE state = 'CLOSED' so a slow GraphQL fetch cannot repopulate solved_by_pr after a reopen webhook cleared it.
  • Add unit tests for the happy path, reopen-during-fetch race, and early exit when the issue is already OPEN.

Related Issues

Fixes #199

Type of Change

  • Bug fix
  • New feature
  • Refactor
  • Documentation
  • Other (describe below)

Testing

  • npm run build in packages/das passes
  • npm run lint passes
  • npm run test -- fetch.processor.spec.ts passes
  • New tests cover:
    • solved_by_pr written when issue remains CLOSED after fetch
    • No row updated when issue was reopened during fetch (affected === 0)
    • Fetch skipped and solved_by_pr cleared when job starts with OPEN issue

Checklist

  • I have read the Contributing Guide
  • Code builds without errors
  • New and existing tests pass (if applicable)
  • Documentation updated (if applicable)
  • No unnecessary dependencies added

@xiao-xiao-mao xiao-xiao-mao Bot added the bug Something isn't working label Jun 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[bug] ISSUE_CLOSURE job can write solved_by_pr onto a reopened (OPEN) issue after async GraphQL fetch

1 participant