Skip to content

[Improvement]: Enforce read_file maximum size or stream large files via Tauri channels #87

@matiaspalmac

Description

@matiaspalmac

Describe the improvement

read_file at apps/desktop/src-tauri/src/lib.rs:151-154 returns the entire file as a String with no size limit. Opening a 200 MB log consumes >500 MB of RAM through serialization, copying and webview parsing, and can crash the renderer. Similar patterns exist in get_recursive_file_list and get_git_file_diff.

Proposed change:

  1. Reject read_file for files larger than a configurable threshold (default 10 MB) with a clear error.
  2. For text viewers, provide a streaming path via Tauri v2 channels that emits chunks.
  3. Document the size limit as a user-visible setting.

Would you like to implement this improvement yourself by sending a PR?

Maybe

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions