fix list_tasks pagination #31

Closed
opened 2026-08-21 21:12:46 +00:00 by Mark · 1 comment
Owner

Bug: VikunjaClient.list_tasks silently drops page 2+ — ground-truth reads incomplete for any project with >50 tasks.

VikunjaClient.list_tasks in both:

  • src/server/vikunja_api.py (line ~506)
  • ~/.hermes/scripts/org-subscriber/vikunja_api.py (line ~506)
    only fetches page 1. Vikunja v2.3.0 returns 50 tasks per page by default; project 3 (org_mode) currently has 57 tasks (2 pages). Every consumer using these methods operates on incomplete ground truth:
  • vikunja-kanban-sync (outbound catch-up cron)
  • vikunja-todo-runner (inbound task executor)
  • vikunja-project-init / vikunja-project-scan
  • any future PM-cycle ground-truth read

Verified headers (live GET /projects/3/tasks, 2026-08-21 21:05 UTC):

  • x-pagination-result-count: 50
  • x-pagination-total-pages: 2

Verified impact: in a recent PM round (kanban t_9ac29016) tasks #106 and #107 were created on page 2; they were only verifiable via get_task(id) directly — list_tasks could not have surfaced them. Today, list_tasks initially returned 50 tasks all done=True (missing the 2 open ones); only the full pagination scan returned the truthful 57 tasks / 2 open. This is a substrate defect.

Fix: change VikunjaClient.list_tasks to iterate page=1..N until x-pagination-total-pages is exhausted (or until a page returns < per_page results). Update both copies of the file. Add a unit test that asserts list_tasks returns >= N for a project known to have N tasks.

Acceptance:

  • list_tasks(3) returns all 57 org_mode tasks (was 50).
  • Existing unit tests still pass; new pagination test passes.
  • vikunja-kanban-sync, vikunja-todo-runner consumers verified working on full task set (no silent loss).

Source: Vikunja task #109 (org_mode project) — filed from kanban tasker card t_c47ff2c0.

Bug: VikunjaClient.list_tasks silently drops page 2+ — ground-truth reads incomplete for any project with >50 tasks. VikunjaClient.list_tasks in both: - src/server/vikunja_api.py (line ~506) - ~/.hermes/scripts/org-subscriber/vikunja_api.py (line ~506) only fetches page 1. Vikunja v2.3.0 returns 50 tasks per page by default; project 3 (org_mode) currently has 57 tasks (2 pages). Every consumer using these methods operates on incomplete ground truth: - vikunja-kanban-sync (outbound catch-up cron) - vikunja-todo-runner (inbound task executor) - vikunja-project-init / vikunja-project-scan - any future PM-cycle ground-truth read Verified headers (live GET /projects/3/tasks, 2026-08-21 21:05 UTC): - x-pagination-result-count: 50 - x-pagination-total-pages: 2 Verified impact: in a recent PM round (kanban t_9ac29016) tasks #106 and #107 were created on page 2; they were only verifiable via get_task(id) directly — list_tasks could not have surfaced them. Today, list_tasks initially returned 50 tasks all done=True (missing the 2 open ones); only the full pagination scan returned the truthful 57 tasks / 2 open. This is a substrate defect. Fix: change VikunjaClient.list_tasks to iterate page=1..N until x-pagination-total-pages is exhausted (or until a page returns < per_page results). Update both copies of the file. Add a unit test that asserts list_tasks returns >= N for a project known to have N tasks. Acceptance: - list_tasks(3) returns all 57 org_mode tasks (was 50). - Existing unit tests still pass; new pagination test passes. - vikunja-kanban-sync, vikunja-todo-runner consumers verified working on full task set (no silent loss). Source: Vikunja task #109 (org_mode project) — filed from kanban tasker card t_c47ff2c0.
Author
Owner

Fix verified landed and closed out by root kanban t_c47ff2c0 (substrate-defect pagination bug, Vikunja #109).

Commits on origin/main referencing this issue:

  • 06002bf fix(server): paginate list_tasks across all pages (org_mode#31)
  • 71a2b38 style(lint): fix ruff F401 and E401 violations (org_mode#31 gate)

Both file copies carry the page=1..N loop with short-page break + _MAX_TASK_PAGES cap:

  • src/server/vikunja_api.py:537
  • ~/.hermes/scripts/org-subscriber/vikunja_api.py:581

Verification (t_4af8fee6, 2026-08-23): full pytest suite 843/843 green, 8 pagination tests pass, live list_tasks(3) on deployed copy returned 75 tasks across 2 pages (target 57). No consumer calls client.list_tasks directly, so no signature-drift risk. Acceptance criteria met. Closing.

Fix verified landed and closed out by root kanban t_c47ff2c0 (substrate-defect pagination bug, Vikunja #109). Commits on origin/main referencing this issue: - 06002bf fix(server): paginate list_tasks across all pages (org_mode#31) - 71a2b38 style(lint): fix ruff F401 and E401 violations (org_mode#31 gate) Both file copies carry the page=1..N loop with short-page break + _MAX_TASK_PAGES cap: - src/server/vikunja_api.py:537 - ~/.hermes/scripts/org-subscriber/vikunja_api.py:581 Verification (t_4af8fee6, 2026-08-23): full pytest suite 843/843 green, 8 pagination tests pass, live list_tasks(3) on deployed copy returned 75 tasks across 2 pages (target 57). No consumer calls client.list_tasks directly, so no signature-drift risk. Acceptance criteria met. Closing.
Mark closed this issue 2026-08-24 00:18:32 +00:00
Sign in to join this conversation.
No description provided.