Skip to content

perf(scanning): handle 100k+ findings without OOM #9

Description

@Metbcy

Problem

The v0.6.1 perf work made the FindingsTable responsive on 20k findings. The next ceiling is the API itself: GET /api/v1/scans/{id}/findings returns ALL findings in one JSON response. At 100k findings that's roughly 70 MB of JSON parsed by both the server and the browser.

Acceptance criteria

  • New paginated endpoint: GET /api/v1/scans/{id}/findings?cursor=&limit=&severity=&status=&scanner=&q=.
  • Cursor-based pagination (stable across concurrent inserts).
  • Backward compat: legacy un-paged endpoint stays for 1 minor release with a Deprecation header, then dropped.
  • Frontend FindingsTable switches to infinite-scroll / windowed pagination instead of loading all rows.
  • Filter / search predicates pushed down to SQL (current implementation does them client-side after fetching all).

Suggested approach

DB: add a composite index (scan_id, severity_rank, fingerprint) for stable cursor pagination.
API: cursor = base64(last_seen_fingerprint).
Frontend: react-virtuoso or @tanstack/react-virtual for windowed rendering.

Difficulty

~2 days. Real architectural work; touches DB, API, frontend.

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedExtra attention is neededperformanceSpeed / scale / footprint

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions