🤖 refactor: merge the two supersede loops in drainTerminalAttention
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 73/100
- Issue type
- Refactor
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- typescript
- Domain
- backend
Research direction
Read src/node/services/taskService.ts around TaskService.drainTerminalAttention, then inspect the pending terminal-attention notification tests. After the stack that splits the method into named steps merges, combine the duplicate superseding loops in a helper and add coverage for both missing and archived owner workspaces. Done means both states supersede every pending notification while preserving the race-sensitive behavior.
Written by the indexing model from the issue text.
Description
TaskService.drainTerminalAttention has two identical loops that mark every pending terminal-attention notification superseded: one when the owner workspace no longer exists, one when it is archived (src/node/services/taskService.ts, near the start of the method, at origin/main e70e363471: lines 11483-11485 and 11493-11495).
The stack that splits drainTerminalAttention into named steps keeps both loops inline, on purpose. A shared async helper adds one awaited call, so the code after it runs one microtask later. That stack is move-only, and an earlier split (#7681) showed that one extra microtask can change a race test.
Follow-up: after that stack merges, merge the two loops into one helper in its own PR, with a test that both owner states still supersede every pending notification.
Generated with xum • Model: anthropic:claude-opus-5-5 • Thinking: high • Cost: $157.52
- Dominant language
- TypeScript
- Stars
- 2.1k
- Forks
- 139
- Avg merge
- 3h 35m
- Merged PRs (30d)
- 950
Getting set up
- Ships a Dockerfile or Docker Compose file
- No pull request template
- No contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from coder/xum
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
Similar issues
-
mobile-app
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
Open-Locker/Open-Locker#352 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
leanprover-community/lean4game#589 ·
Maintainers usually reply within 2 days
-
Add: CS Action BGOpencheck:passed streams:add
Difficulty 1/5 Under an hour Newbie friendliness 68/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 82/100
unocss/unocss#5421 · 1 comment ·
Maintainers usually reply within 1 day