Restore auto-building when smart import fails - #4256
Open
vogella wants to merge 1 commit into
Open
Conversation
SmartImportJob turns auto-building off for the duration of the import and turns it back on as the last statement of its try block. A configurator that throws, or a cancellation, skips that statement, so the workspace is left with auto-building permanently disabled until the user notices and toggles it manually. Restore the previous setting in a finally block instead. Also null check the optional import listener when closing projects after the import.
Contributor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The smart import job disables workspace auto-building while it runs and re-enables it as the last statement of its try block. If a project configurator throws or the import is cancelled, that statement is skipped and the workspace is left with auto-building permanently off, which is confusing because nothing points back at the failed import.
Restoring the setting in a finally block fixes this, and the optional import listener is now null checked when projects are closed after the import. The new test asserts both that the failing import reports an error status and that auto-building survives it.