Skip to content

fix: surface git diff and search-click errors instead of swallowing them#50

Merged
jmaxdev merged 2 commits intoTrixtyAI:mainfrom
matiaspalmac:fix/git-command-error-swallow
Apr 19, 2026
Merged

fix: surface git diff and search-click errors instead of swallowing them#50
jmaxdev merged 2 commits intoTrixtyAI:mainfrom
matiaspalmac:fix/git-command-error-swallow

Conversation

@matiaspalmac
Copy link
Copy Markdown
Contributor

Chages

get_git_diff now checks status.success()

  • On failure it returns stderr instead of an empty stdout, matching the pattern already used by every other git_* command in lib.rs.
  • Before: broken repos / permission issues showed up as "no differences" in the UI.

handleSearchClick logs read_file errors instead of an empty catch {}

  • Now catch (e) { console.error(e); }, consistent with the sibling handleSearch.
  • Before: a stale search result (file deleted/moved after indexing) would produce a click that silently did nothing with zero console trace.

No behavior change on the happy path; this only affects the error branches.

Issues

Copilot AI review requested due to automatic review settings April 19, 2026 16:38
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes two silent-failure paths in the desktop Git Explorer so real underlying errors (git command failures and stale search result clicks) are surfaced instead of being mistaken for “no diff” / “nothing happened,” addressing issue #49.

Changes:

  • Update the Tauri get_git_diff command to return stderr on non-zero exit status (instead of always returning stdout).
  • Update handleSearchClick to log read_file errors instead of swallowing them with an empty catch.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
apps/desktop/src/addons/builtin.git-explorer/GitExplorerComponent.tsx Stops swallowing read_file errors on search-result click, improving diagnosability.
apps/desktop/src-tauri/src/lib.rs Aligns get_git_diff error handling with other git_* commands by checking output.status.success().

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread apps/desktop/src/addons/builtin.git-explorer/GitExplorerComponent.tsx Outdated
- get_git_diff: return stderr on non-zero exit, matching the pattern used by the other git_* commands
- handleSearchClick: log read_file failures to the console instead of silently swallowing them, consistent with handleSearch
safeInvoke already logs Tauri invoke errors to the console when silent
is not set, so the local catch was duplicating the trace. Pass silent:
true and log once from the handler with the file_path for context.
@jmaxdev jmaxdev force-pushed the fix/git-command-error-swallow branch from 036144a to 52ec47a Compare April 19, 2026 17:34
@jmaxdev jmaxdev added the Fix label Apr 19, 2026
@jmaxdev jmaxdev merged commit b9c34f7 into TrixtyAI:main Apr 19, 2026
4 checks passed
@matiaspalmac matiaspalmac deleted the fix/git-command-error-swallow branch April 20, 2026 22:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Silent failures in git explorer error handling

3 participants