Skip to content

fix(router): clear linear work item locks by canonical id#1160

Merged
zbigniewsobiecki merged 1 commit intomongrel-intelligence:devfrom
maksymilian-majer:fix/linear-comment-lock-cleanup
Apr 22, 2026
Merged

fix(router): clear linear work item locks by canonical id#1160
zbigniewsobiecki merged 1 commit intomongrel-intelligence:devfrom
maksymilian-majer:fix/linear-comment-lock-cleanup

Conversation

@maksymilian-majer
Copy link
Copy Markdown
Contributor

Summary

Fix stale work-item locks for Linear-triggered jobs by using the canonical triggerResult.workItemId during worker cleanup when it is available.

Linear jobs keep the raw Linear issue UUID on top-level workItemId, while router enqueue locking uses the trigger result canonical work item id, such as TEAM-123. Cleanup previously cleared the UUID key, leaving the canonical lock in memory until TTL or router restart.

Test Plan

  • Unit tests pass (npm test)
  • Linter passes (npm run lint)
  • Type check passes (npm run typecheck)
  • Tested manually: reproduced the stale Linear comment lock locally, rebuilt/restarted router and dashboard, and verified health endpoints

Additional verification:

  • npm test -- tests/unit/router/worker-env.test.ts
  • npm run typecheck
  • npm run build
  • npm run verify
  • pre-push npm run test:fast -- --changed origin/dev

Checklist

  • My code follows the project's code style
  • I have added tests for new functionality
  • I have updated documentation if needed
  • My commits follow Conventional Commits

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 22, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@zbigniewsobiecki zbigniewsobiecki requested a review from aaight April 22, 2026 18:13
Copy link
Copy Markdown
Collaborator

@nhopeatall nhopeatall left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Summary

LGTM! The fix correctly aligns the lock clearing ID with the lock setting ID by preferring triggerResult.workItemId for linear jobs, successfully resolving the stale work-item lock issue. Tests correctly cover both the primary and fallback paths.

🕵️ opencode · google/gemini-3.1-pro-preview · run details

@zbigniewsobiecki zbigniewsobiecki merged commit af5a5b6 into mongrel-intelligence:dev Apr 22, 2026
6 checks passed
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.

3 participants