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

Avoid panic by only restoring workspace if UI has launched #18386

Merged
merged 1 commit into from
Sep 26, 2024

Conversation

mrnugget
Copy link
Member

This should fix the unregistered setting type workspace::workspace_settings::WorkspaceSettings panic that came from inside restorable_workspace_locations.

We tracked it down to a possible scenario (we can't recreate it though) in which app.on_reopen is called before the app has finished launching.

In any case, this check makes sense, because we only want to restore a workspace in case the whole app has launched with a UI.

Release Notes:

  • N/A

This should fix the `unregistered setting type
workspace::workspace_settings::WorkspaceSettings` panic that came from
inside `restorable_workspace_locations`.

We tracked it down to a possible scenario (we can't recreate it though)
in which `app.on_reopen` is called before the app has finished
launching.

In any case, this check makes sense, because we only want to restore a
workspace in case the whole app has launched with a UI.

Co-authored-by: Bennet <bennet@zed.dev>
@cla-bot cla-bot bot added the cla-signed The user has signed the Contributor License Agreement label Sep 26, 2024
@mrnugget mrnugget merged commit 140d702 into main Sep 26, 2024
7 checks passed
@mrnugget mrnugget deleted the avoid-panic-on-reopen branch September 26, 2024 10:27
schpet added a commit to schpet/zed that referenced this pull request Sep 27, 2024
…reee

* origin/main:
  git blame gutter: Use smallest possible space (zed-industries#18145)
  Fix minimum gutter line number spacing (zed-industries#18021)
  terraform: Bump to v0.1.1 (zed-industries#18382)
  lsp: Do not notify all language servers on file save (zed-industries#17756)
  Remove leftover println statements (zed-industries#18389)
  Fix `use_on_type_format` setting being unused per language (zed-industries#18387)
  Avoid panic by only restoring workspace if UI has launched (zed-industries#18386)
  Fix Typo in rust language guide (zed-industries#18383)
  editor: Fix cursor shape not restoring when setting removed (zed-industries#18379)
  Avoid unwrap in file finder (zed-industries#18374)
noaccOS pushed a commit to noaccOS/zed that referenced this pull request Oct 19, 2024
…tries#18386)

This should fix the `unregistered setting type
workspace::workspace_settings::WorkspaceSettings` panic that came from
inside `restorable_workspace_locations`.

We tracked it down to a possible scenario (we can't recreate it though)
in which `app.on_reopen` is called before the app has finished
launching.

In any case, this check makes sense, because we only want to restore a
workspace in case the whole app has launched with a UI.

Release Notes:

- N/A

Co-authored-by: Bennet <bennet@zed.dev>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla-signed The user has signed the Contributor License Agreement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant