Skip to content

CaptureService.ListAsync full-table load — O(N) memory per inbox request #1193

@Chris0Jeky

Description

@Chris0Jeky

Summary

ListAsync calls GetByUserAsync(userId) which materializes the entire user's LLM request history into memory (no limit or status filter), then filters/pages in C#. For users with thousands of captures, this loads all rows on every inbox load.

Location

backend/src/Taskdeck.Application/Services/CaptureService.cs, lines 101-159

Suggested Fix

Add an indexed, server-side query with LIMIT and optional status filter on GetByUserAsync, or introduce GetCaptureItemsPagedAsync(userId, status, limit, offset).

Source

Found during codebase health analysis (2026-06-06).

Metadata

Metadata

Assignees

No one assigned

    Projects

    Status
    Pending

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions