fix: SafeReadSide swallows all errors silently#1
Open
AmSach wants to merge 1 commit into
Open
Conversation
…errors SafeReadSide silently caught all exceptions and returned string.Empty, preventing the existing IsFaulted handler in LoadAsync from ever reaching for read failures. Now we call _repository.ReadSide directly; any exception propagates into t.IsFaulted and ApplyResult shows a user-facing 'Failed to read blobs: ...' message instead of a silent empty pane or misleading 'all lines added/removed' diff.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixed the bug described in issue geevensingh#27.
What was wrong
SafeReadSidecaught all exceptions silently and returnedstring.Empty, so users saw an empty pane or misleading 'all lines added/removed' diff with no error indication. Critically, the existing fault-handler inLoadAsync(which surfacesFailed to read blobs: ...viaApplyResult) was unreachable for read failures.How I fixed it
Replaced the
SafeReadSidecalls with direct_repository.ReadSide()calls inside theTask.Run. Now any exception from reading the blob propagates into the task'sIsFaultedstate, and the existingContinueWithhandler catches it and shows a clear user-facing error message. Option A from the issue.Changes
DiffViewer/ViewModels/DiffPaneViewModel.cs: 2 lines changed (removedSafeReadSidewrapper calls, now inlined)Closes geevensingh#27