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

Malformed recentworkspaces.json can crash startup #10250

Closed
colin-grant-work opened this issue Oct 11, 2021 · 0 comments · Fixed by #10711
Closed

Malformed recentworkspaces.json can crash startup #10250

colin-grant-work opened this issue Oct 11, 2021 · 0 comments · Fixed by #10711
Labels
bug bugs found in the application workspace issues related to the workspace

Comments

@colin-grant-work
Copy link
Contributor

Bug Description:

We use a file called recentworkspaces.json to track the user's recent workspaces so that we can populate the 'recent workspaces' list and restore the workspace used in the last session. If that file contains valid JSON but is in some way malformed, it can crash startup. In general, we shouldn't have to worry much, because users shouldn't touch that file (In my case, making changes to the JSONRPC system seems to have caused a bad write), but it might be good to make the code that handles it more robust so that we can startup when it's a bad state, and perhaps clear or repair it.

Steps to Reproduce:

  1. Open your recentworkspaces.json file (default location is ~/.theia/recentworkspaces.json)
  2. It should be in the form {"recentRoots": ["root1", "root2", ...]}
  3. Modify it so that it has the form {"recentRoots": [["root1"], "root2"]}
  4. Start the application (I was using Electron)
  5. The application should fail to start, and the backend logs should have a message about missing fsPath of undefined.

Additional Information

  • Operating System: RHEL7, Electron
  • Theia Version: master
@colin-grant-work colin-grant-work added bug bugs found in the application workspace issues related to the workspace labels Oct 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug bugs found in the application workspace issues related to the workspace
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant