Skip to content

fix: task list 500s when combining assignee_id=null with assignee_ids#276

Merged
pikann merged 1 commit into
masterfrom
fix/task-filter-unbalanced-parens
Jul 15, 2026
Merged

fix: task list 500s when combining assignee_id=null with assignee_ids#276
pikann merged 1 commit into
masterfrom
fix/task-filter-unbalanced-parens

Conversation

@pikann

@pikann pikann commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Fixes a missing closing parenthesis in applyTaskFilter (services/api/internal/repository/postgres/task_repository.go) that produced an unbalanced-parens WHERE clause whenever both the "unassigned" filter and the "assigned to specific users" filter were combined (assignee_id=null + assignee_ids=<uuid>), causing Postgres to reject the query with a syntax error and the task list endpoint to 500.
  • Adds a regression test (task_repository_test.go) exercising CountTasks with AssigneeNull and AssigneeIDs both set, which fails with the old code (incomplete input) and passes with the fix.

Test plan

  • go build ./...
  • go test ./internal/repository/postgres/...
  • Verified the new test fails against the pre-fix code (reverted the fix locally, confirmed incomplete input SQL error) and passes with the fix applied.

Fixes #272

🤖 Generated with Claude Code

Combining the "unassigned" filter (assignee_id=null) with the
"assigned to specific users" filter (assignee_ids=<uuid>) produced a
WHERE clause with unbalanced parentheses, causing Postgres to reject
the query with a syntax error and the task list endpoint to 500.

Fixes #272

Co-authored-by: R0hit-Sriram <222852898+R0hit-Sriram@users.noreply.github.com>

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

✅ No new issues found.

Reviewed changes — fixed an unbalanced-parentheses SQL clause generated by applyTaskFilter when AssigneeNull and AssigneeIDs are both set, and added a regression test for the combined filter.

  • Balanced the assignee_id IS NULL OR IN clause — adds the missing closing ) in services/api/internal/repository/postgres/task_repository.go.
  • Added task_repository_test.go — uses an in-memory SQLite database to exercise CountTasks with AssigneeNull: true and a non-empty AssigneeIDs list, matching the pattern used by other repository tests in this package.

Pullfrog  | View workflow run | Using Kimi K2 (free via Pullfrog for OSS) | 𝕏

@pikann
pikann merged commit fc9fa6d into master Jul 15, 2026
7 checks passed
@pikann
pikann deleted the fix/task-filter-unbalanced-parens branch July 15, 2026 12:25
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.

Task list 500s when combining assignee_id=null with assignee_ids (unbalanced parens in SQL filter)

1 participant