Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix crash on Edit Code #2699

Merged
merged 12 commits into from
Nov 28, 2024
Merged

Fix crash on Edit Code #2699

merged 12 commits into from
Nov 28, 2024

Conversation

mkondratek
Copy link
Contributor

@mkondratek mkondratek commented Nov 27, 2024

Closes https://linear.app/sourcegraph/issue/QA-180/jetbrains-crash-occurred-while-clicking-on-edit-code-after-restarting.

Test plan

See the linear issue.
You can try removing AccountData entry from workspace.xml before opening the project.

Changes

First I tried to simply setActiveAccount for the deprecated manager. This is not the best solution as do not know some values for the account (name, displayName, id). We could hardcode some values but we would be persisting some artificial data for a simple task that is - all we need is to store the llm that was used for Edit Prompt most recently.

So instead of hacking & mocking the deprecated logic (HistoryService is used basically only for history reasons, migrations, etc)... instead of that, let's simply use a simply dedicated storage class.

Also, it could be an actual storage with a corresponding storage file (.xml) but do we really need it? Project session persistence should the enough for most users.

@mkondratek mkondratek self-assigned this Nov 27, 2024
@mkondratek mkondratek changed the title Remove redundant field from HistoryService Fix crash on Edit Code Nov 27, 2024
Copy link
Contributor

@pkukielka pkukielka left a comment

Choose a reason for hiding this comment

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

LGTM

@mkondratek mkondratek merged commit c321119 into main Nov 28, 2024
6 of 7 checks passed
@mkondratek mkondratek deleted the mkondratek/fix/editCode-account branch November 28, 2024 11:05
@sourcegraph-release-bot

The backport to jb-v7.4.x failed at https://github.com/sourcegraph/jetbrains/actions/runs/12067657791:

Reviews may only be requested from collaborators. One or more of the teams you specified is not a collaborator of the sourcegraph/jetbrains repository.

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 jb-v7.4.x -p 2699
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-jb-v7.4.x jb-v7.4.x
# Navigate to the new working tree
cd .worktrees/backport-jb-v7.4.x
# Create a new branch
git switch --create backport-2699-to-jb-v7.4.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 c3211191996b35e745c9b0988d1f2a8018154479
# Push it to GitHub
git push --set-upstream origin backport-2699-to-jb-v7.4.x
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-jb-v7.4.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-2699-to-jb-v7.4.x
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-jb-v7.4.x
  • Follow above instructions to backport the commit.
  • Create a pull request where the base branch is jb-v7.4.x and the compare/head branch is backport-2699-to-jb-v7.4.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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants