workaround: stop discoveries before install/uninstall boards/libs #674
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.
Why
After installing a board/library the discoveries are be broken: plugging or unplugging a board has no effect on the UI.
This issue is 100% reproducible on windows and a minority of mac users are affected as well.
The reason is that, in some circumstances that need to be further investigated, the CLI is not sending the
quit
orend
message when an install/uninstall action is perfomed. ( cc @silvanocerza )This causes the IDE not to restart the watchers on the board discoveries when needed (as it's never been informed they ever stopped).
Being the watchers broken, the UI do not react to changes that communicated (correctly) from the CLI.
How
This workaround perform a stop of the discoveries from the IDE side before any install/uninstall operation.
Calling the stop from the IDE actually fixes the problem as the CLI correctly answers with the
end
message and the IDE can be informed and hence restart the discoveries when needed.Note
This is a workaround as the correct way to approach the issue should be on the CLI side: there is no reason why the business logic of stopping/restarting the boards watchers shoud be on the IDE.
The IDE should be transparent to what happens on the CLI side, as the CLI should just stop sending the boardsList messages when an install/uninstall is in progress, then communicate the new state to the IDE at the end of its internal routines
fixes #671