Describe the bug
Clicking a binary file in the explorer whose extension isn't in the hardcoded bin list produces a noisy console error even though the code already handles the case gracefully (it shows the "binary file" placeholder in the editor).
In apps/desktop/src/addons/builtin.git-explorer/GitExplorerComponent.tsx the file click handler calls invoke("read_file", ...) without { silent: true }. When Rust returns stream did not contain valid UTF-8, safeInvoke logs it via console.error before re-throwing. The caller then catches the error and opens the file with the editor.bin_file placeholder, so the user flow is fine — but the error is already in the console.
[Tauri Invoke Error] read_file: "stream did not contain valid UTF-8"
src/api/tauri.ts (94:17) @ safeInvoke
...
async handleEntryClick
src/addons/builtin.git-explorer/GitExplorerComponent.tsx (262:23)
The hardcoded bin list only covers .png/.jpg/.jpeg/.gif/.exe/.dll/.bin/.zip/.pdf/.ico/.woff/.woff2/.ttf — many binary extensions (.webp, .mp3, .mp4, .class, .jar, .db, .sqlite, .wasm, ...) fall through to read_file, each producing this false-positive error.
As a side issue, the current catch only handles the UTF-8 case; any other read failure (permission denied, file locked, etc.) is silently swallowed — the click does nothing and the user gets no feedback.
Steps to Reproduce
pnpm desktop.
- Open a folder containing a binary file whose extension isn't in the hardcoded bin list (e.g.
.webp, .mp3, .sqlite).
- Click the file in the explorer.
- Open DevTools Console → see
[Tauri Invoke Error] read_file: "stream did not contain valid UTF-8".
Trixty Version
v1.0.8 (main @ 50923f8)
OS
Windows
Fix yourself?
Yes
Describe the bug
Clicking a binary file in the explorer whose extension isn't in the hardcoded bin list produces a noisy console error even though the code already handles the case gracefully (it shows the "binary file" placeholder in the editor).
In
apps/desktop/src/addons/builtin.git-explorer/GitExplorerComponent.tsxthe file click handler callsinvoke("read_file", ...)without{ silent: true }. When Rust returnsstream did not contain valid UTF-8,safeInvokelogs it viaconsole.errorbefore re-throwing. The caller then catches the error and opens the file with theeditor.bin_fileplaceholder, so the user flow is fine — but the error is already in the console.The hardcoded bin list only covers
.png/.jpg/.jpeg/.gif/.exe/.dll/.bin/.zip/.pdf/.ico/.woff/.woff2/.ttf— many binary extensions (.webp,.mp3,.mp4,.class,.jar,.db,.sqlite,.wasm, ...) fall through toread_file, each producing this false-positive error.As a side issue, the current catch only handles the UTF-8 case; any other read failure (permission denied, file locked, etc.) is silently swallowed — the click does nothing and the user gets no feedback.
Steps to Reproduce
pnpm desktop..webp,.mp3,.sqlite).[Tauri Invoke Error] read_file: "stream did not contain valid UTF-8".Trixty Version
v1.0.8 (main @ 50923f8)
OS
Windows
Fix yourself?
Yes