Skip to content

[backend] Scans() and ScansPage() load per-workspace history without a server-side cap — growth is unbounded #111

Closed

Description

@devin-ai-integration

startScan calls s.db.Scans(ctx, work.ID) (server.go:1459) which returns every scan ever run on the workspace just to check "is anything non-terminal" — the same pattern in deleteWorkspace (server.go:722). With demo data (18 scans × 120 workspaces) this is small, but scan history is unbounded — prune only runs when the user calls it. A workspace with a year of daily scans loads thousands of rows for a boolean check.

Same for FindingIdentities and Findings in report/compare paths — no LIMIT on what can grow. scans.state should also be indexed (check schema) — filtering "non-terminal" rows currently means scanning the table.

Activity

  1. sanketpatel32 commented on Nov 22, 2026

    @sanketpatel32
    Owner

    Not fixed — Scans/ScansPage still load unbounded per-workspace history. Queued.

  2. devin-ai-integration commented on Nov 22, 2026

    @devin-ai-integration
    ContributorAuthor

    Fixed in #152 — the remaining unbounded Scans() callers (history_cmd, stats_cmd, workspace_cmd, cli_common) now use bounded ScansPage; Scans() is documented as tests/dumps only.

  3. devin-ai-integration commented on Nov 22, 2026

    @devin-ai-integration
    ContributorAuthor

    Fixed in PR #152 — see the earlier comment for the specific change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions