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:
- Reject
read_file for files larger than a configurable threshold (default 10 MB) with a clear error.
- For text viewers, provide a streaming path via Tauri v2 channels that emits chunks.
- Document the size limit as a user-visible setting.
Would you like to implement this improvement yourself by sending a PR?
Maybe
Describe the improvement
read_fileatapps/desktop/src-tauri/src/lib.rs:151-154returns the entire file as aStringwith 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 inget_recursive_file_listandget_git_file_diff.Proposed change:
read_filefor files larger than a configurable threshold (default 10 MB) with a clear error.Would you like to implement this improvement yourself by sending a PR?
Maybe