Fix the IPC message processing on scide #5015
Merged
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.
Purpose and Motivation
Fixes: #4688
This is a pretty nasty bug that causes all sorts of random failures. The message processor for the IPC between ide and lang will fail if it doesn't process a message in one go because it loses track of the remaining available data.
When this happens, it never recovers, causing all sort of problems in the IDE, anything that depends on ScIDE.send stops to work, include the HelpBrowser. The only way to recover is restarting the whole IDE.
Please see #4688 for an easy way to reproduce the problem.
On Linux you might need a bigger value (60000 for example) and a few tries to trigger the bug, but it is pretty constant. I think other bugs reported are also caused by this, including in quarks that use a lot the interaction between the IDE and language such as @adcxyz 's SyncText. @adcxyz helped me to track this down.
Types of changes
To-do list