Skip to content
This repository was archived by the owner on Sep 30, 2024. It is now read-only.

Blame: fix some issues with the stream#63865

Merged
camdencheek merged 2 commits into
mainfrom
cc/fix-blame-stream
Jul 18, 2024
Merged

Blame: fix some issues with the stream#63865
camdencheek merged 2 commits into
mainfrom
cc/fix-blame-stream

Conversation

@camdencheek

@camdencheek camdencheek commented Jul 16, 2024

Copy link
Copy Markdown
Member

Contributes to SRCH-738

Notably, this does not yet identify the root cause of SRCH-738, but it does identify and fix some confounding bugs. It's possible that these actually also cause some of the issues in SRCH-738, but I wanted to at least push these to dotcom, where we can reproduce some of the weirdness. At the very least, it doesn't explain the auth errors being reported.

Test plan

Tested that, in the event of an error

  1. we don't retry forever, and
  2. we display the error to the user in an alert, but do not block viewing the rest of the page

Before:
screenshot-2024-07-16_17-14-59@2x

After:
screenshot-2024-07-16_17-07-44@2x

Changelog

  • Fixed an issue with blame view that can cause retry loops and error pages that block interaction with the rest of the UI

@cla-bot cla-bot Bot added the cla-signed label Jul 16, 2024
Comment thread client/web/src/repo/blame/shared.ts Outdated
Comment on lines 168 to 170

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Looking over the documentation for fetchEventSource, it will retry automatically if onError does not re-throw the error. We will publish the error to the observable in the error callback of the fetchEventSource promise, so we do not need to publish the error here.

Comment thread client/web/src/repo/blame/shared.ts Outdated

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

If we don't throw an error here, the stream doesn't end properly.

@camdencheek camdencheek changed the title Blame: fix some issues Blame: fix some issues with the stream Jul 16, 2024
@camdencheek camdencheek marked this pull request as ready for review July 16, 2024 23:26
Comment thread client/web/src/repo/blame/hooks.ts Outdated
Comment on lines 58 to 63

@camdencheek camdencheek Jul 16, 2024

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

useObservable throws an error rather than returns one. So to satisfy the return type of this function, we need to catch that error and return an ErrorLike. Since we weren't catching the error, we were getting ugly full-page errors rather than the nice alert at the top of the page as was intended.

@camdencheek camdencheek requested a review from a team July 17, 2024 02:18
@camdencheek camdencheek force-pushed the cc/fix-blame-stream branch from c2feca9 to bd4781e Compare July 17, 2024 18:00
@camdencheek camdencheek force-pushed the cc/fix-blame-stream branch from 9ebafb8 to 8608152 Compare July 17, 2024 18:16
@burmudar burmudar marked this pull request as draft July 17, 2024 18:32
@burmudar burmudar marked this pull request as ready for review July 17, 2024 18:32
@camdencheek camdencheek merged commit d91fab3 into main Jul 18, 2024
@camdencheek camdencheek deleted the cc/fix-blame-stream branch July 18, 2024 18:53
@sourcegraph-release-bot

Copy link
Copy Markdown
Collaborator

The backport to 5.5.x failed at https://github.com/sourcegraph/sourcegraph/actions/runs/10000159468:

The process '/usr/bin/git' failed with exit code 1

To backport this PR manually, you can either:

Via the sg tool

Use the sg backport command to backport your commit to the release branch.

sg backport -r 5.5.x -p 63865
Via your terminal

To backport manually, run these commands in your terminal:

# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-5.5.x 5.5.x
# Navigate to the new working tree
cd .worktrees/backport-5.5.x
# Create a new branch
git switch --create backport-63865-to-5.5.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 d91fab39e287d57d00f35fb8952f5b7daabfa1d2
# Push it to GitHub
git push --set-upstream origin backport-63865-to-5.5.x
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-5.5.x

If you encouter conflict, first resolve the conflict and stage all files, then run the commands below:

git cherry-pick --continue
# Push it to GitHub
git push --set-upstream origin backport-63865-to-5.5.x
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-5.5.x
  • Follow above instructions to backport the commit.
  • Create a pull request where the base branch is 5.5.x and the compare/head branch is backport-63865-to-5.5.x., click here to create the pull request.

Once the pull request has been created, please ensure the following:

  • Make sure to tag @sourcegraph/release in the pull request description.

  • kindly remove the release-blocker from this pull request.

@sourcegraph-release-bot sourcegraph-release-bot added backports failed-backport-to-5.5.x release-blocker Prevents us from releasing: https://about.sourcegraph.com/handbook/engineering/releases labels Jul 18, 2024
camdencheek added a commit that referenced this pull request Jul 18, 2024
Contributes to SRCH-738

Notably, this does not yet identify the root cause of SRCH-738, but it
does identify and fix some confounding bugs. It's possible that these
actually also _cause_ some of the issues in SRCH-738, but I wanted to at
least push these to dotcom, where we can reproduce some of the
weirdness. At the very least, it doesn't explain the auth errors being
reported.

(cherry picked from commit d91fab3)
craigfurman pushed a commit that referenced this pull request Jul 22, 2024
Contributes to SRCH-738

Notably, this does not yet identify the root cause of SRCH-738, but it
does identify and fix some confounding bugs. It's possible that these
actually also _cause_ some of the issues in SRCH-738, but I wanted to at
least push these to dotcom, where we can reproduce some of the
weirdness. At the very least, it doesn't explain the auth errors being
reported.

(cherry picked from commit d91fab3)

Co-authored-by: Michael Bahr <michael.bahr@sourcegraph.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

backport 5.5.x backports cla-signed failed-backport-to-5.5.x release-blocker Prevents us from releasing: https://about.sourcegraph.com/handbook/engineering/releases

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants