Skip to content

[P1] [bug] Truncation banner blames LIMIT when MemoryGuard triggered — misleading #413

Closed

Description

@EVWorth

[P1] [bug] MemoryGuard threshold met but truncation banner blames LIMIT (misleading)

Context

rows_truncated = limit.is_some() && row_count >= limit.unwrap() || mem_guard.triggered() (executor.rs:170). Both reasons share the same rows_truncated: true flag and the same banner copy.

Problem

Per docs/audits/results.md F18.

The banner says "Results truncated to N rows. Add a LIMIT clause to fetch fewer rows." but truncation may have been due to MemoryGuard. Suggesting "Add a LIMIT clause" is misleading: a user who already had LIMIT 10000 will add a larger LIMIT, not realizing the cap is RAM.

Files

  • src-tauri/crates/mas-core/src/query/executor.rs:170, 565-607
  • src/components/grid/ResultsGrid.tsx:565-575

Repro (if applicable)

Static analysis only.

Expected

QueryResult gets truncation_reason: Option<TruncationReason> enum (MemoryGuard | RowLimit); banner renders the appropriate message.

Proposed fix

Scope S. Add enum + banner variant.

Acceptance

256 MB available RAM + 100K-row SELECT → "memory pressure" message. 100K-row SELECT with LIMIT 1000 → "Add a LIMIT clause" message.

Needs human verify

Yes

Labels: audit, area/results, severity/p1, kind/bug

Activity

  1. added
    audit
    severity/p1
    kind/bug
    area/results
    on Jul 31, 2026
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

    area/resultsauditkind/bugseverity/p1

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions