Skip to content

Show why a review failed to open instead of spinning forever - #18

Open
derjabkin wants to merge 1 commit into
icsharpcode:mainfrom
derjabkin:error-overlay-opening-review
Open

derjabkin wants to merge 1 commit into
icsharpcode:mainfrom
derjabkin:error-overlay-opening-review

Conversation

@derjabkin

Copy link
Copy Markdown

Show why a review failed to open instead of spinning forever

Problem

Opening a pull request or a branch from the start page puts up the "Preparing the
review workspace" overlay. If the open failed - gh not reachable, a fetch refused,
a ref that does not resolve - the exception went to the global handler, which writes
one log line. Nothing took the overlay down, so the window stayed behind a spinner
that would never stop, with no word of what went wrong.

Change

  • A failed open now replaces the checklist in the overlay with the reason (the first
    line of the tool's own error for a failed command) and a Close button. The same text
    goes to the start page's status line and the Log pane.
  • If "Continue now" was pressed before the failure arrived, the overlay comes back to
    show it.
  • An open cancelled by a later open leaves the later one's overlay alone.

Cancelling the open also has to mean the review already on screen is untouched:

  • OpenPrAsync cleared the offline flags, and OpenLocalRangeAsync overwrote
    DirtyWorktreePath, before anything had been fetched. Both now assign state only
    once the diff has been read, so a failure up to that point changes nothing.

Screenshot

image

Not covered

Opens that do not go through the start page - the PR list pane, reload, the auto-open
with no start page - never showed the overlay and report failures as before.

Testing

Builds with 0 warnings and 0 errors. The error state has not been exercised in the
running app. To check it: open a pull request that has no cached snapshot with the
network off.

A failed open reached only the log, and nothing else takes the
preparation overlay down. It now shows the reason, and the review
on screen is left untouched.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant