Skip to content

feat(hashlists): add permission-gated task count aggregate - #2653

Open
sn0ba11 wants to merge 1 commit into
hashtopolis:masterfrom
sn0ba11:feat/2491-hashlist-task-count
Open

sn0ba11 wants to merge 1 commit into
hashtopolis:masterfrom
sn0ba11:feat/2491-hashlist-task-count

Conversation

@sn0ba11

@sn0ba11 sn0ba11 commented Nov 28, 2026

Copy link
Copy Markdown

Summary

  • Add an optional aggregate[hashlist]=taskCount field to hashlist API responses.
  • Count actual tasks using a grouped database query rather than expanding task relationships into the response.
  • Include archived tasks, deployed supertask subtasks, and tasks on visible parent superhashlists for member hashlist counts.
  • Require Task.READ permission to request the aggregate.
  • Update the OpenAPI specification and add authenticated API regression tests.

Validation

  • 24 authenticated hashlist API tests passed on MySQL, including the new task-count cases.
  • Verified direct, archived, parent/supertask, untouched-hashlist and inaccessible-parent cases.
  • A 1,502-task fixture returned a single scalar task count without expanded task records.
  • Changed PHP files passed syntax checks; Python API tests compiled.
  • Chromium integration against the patched test backend displayed the expected count and enforced permissions.
  • The corresponding Web UI revision passed 3,361 frontend tests and its production build on WinDev.

Additional validation for CI / review

  • PostgreSQL behavior has not been tested locally.
  • The full upstream backend matrix (PHP unit tests, MySQL/PostgreSQL API suites, and real-world dataset jobs) has not yet run.
  • Query latency on very large production datasets has not been benchmarked.
  • Please verify served-versus-committed OpenAPI synchronization in server CI.

Follow-up

A separate Web UI PR will consume the aggregate and reference the backend commit through .backend-ref. That frontend PR depends on this server-side addition.

Refs #2491

Expose an opt-in per-hashlist task count using a grouped query without expanding task resources. Include archived and supertask-associated tasks, respect visible parent hashlists, and enforce Task.READ permission. Update the OpenAPI contract and add authenticated API tests.

Refs hashtopolis#2491
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.

1 participant