Skip to content

[GEN-12] Search index drops letter_id, has_image, has_file — operators silently underreport #355

@intendednull

Description

@intendednull

Audit finding from #300 (commit 679f9fe)

Severity: medium
Category: bug
File: crates/web/src/app.rs:382
Obvious fix: no

Description

When constructing IndexableMessage in app.rs the indexer hard-codes letter_id: None, has_image: false, has_file: false. The search executor's has:image / has:file / in:#letter operators therefore never match anything, despite being part of the public SearchScope / parser API and surfaced in spec text.

Impact / Threat

User-facing — documented search operators silently return zero results; users assume their files / images aren't searchable.

Suggested fix

Derive has_image / has_file from m.attachments (or whatever DisplayMessage exposes) and plumb the letter id from the active letter context.

Verify

rg "letter_id: None,|has_image: false,|has_file: false," crates/web/src/app.rs

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions