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

chore: avoid workspace watcher crashing if folder is deleted #2359

Merged
merged 7 commits into from
Feb 9, 2022

Conversation

SeriousBug
Copy link
Contributor

WorkspaceWatcher was using the deprecated WorkspaceService.isPathInWorkspace to check if something is in workspace. This function does this.config, which runs WorkspaceService.getOrCreateConfig, which will attempt to read the config file, or write it if the config file is missing.

If the folder that should contain the config file is missing, this will cause a ENOENT error.
I think this can happen if the user loads up a Dendron workspace, but then deletes the folder that contains the workspace while VSCode is still running.

@kevinslin
Copy link
Member

looks like a build error

@SeriousBug
Copy link
Contributor Author

My bad, fixed now.

Copy link
Contributor

@hikchoi hikchoi left a comment

Choose a reason for hiding this comment

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

Is there a reason we are fixing the deprecated method instead of the new method?

@jonathanyeung
Copy link
Contributor

Is there a reason we are fixing the deprecated method instead of the new method?

Looks like there are 12 references to the deprecated method. Could we try to migrate those instances instead? Then, we can also clean up IWorkspaceService

@SeriousBug
Copy link
Contributor Author

SeriousBug commented Feb 8, 2022

My bad, I was trying to fix the issue causing the overload of errors in sentry and tried to make the fix as quickly as possible.

The deprecated function is fully removed now.

@SeriousBug
Copy link
Contributor Author

This PR drops the total circular dependency count from 136 to 123.

Copy link
Contributor

@hikchoi hikchoi left a comment

Choose a reason for hiding this comment

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

LGTM!

@kevinslin kevinslin merged commit 9d0325f into master Feb 9, 2022
@kevinslin kevinslin deleted the chore/workspace-watcher-errors branch February 9, 2022 02:26
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.

None yet

4 participants