Juce InternalMessageQueue sometimes starts accumulating messages endlessly, without sending them

Hi, this is an issue that I can trigger with my VST3 plugin on Cakewalk, on Windows 10. When I double click on a note in the piano roll, change its velocity, 50% of the time, this will cause the juce timer thread of my plugin to stop delivering its messages.

All this happens without even showing the GUI of my plugin – I’m just loading the plugin in a single track project, and edit the velocity of one note in the piano roll.

Further inquiry shows that the messages accumulate in juce::InternalMessageQueue . The shouldTriggerMessageQueueDispatch is false because the queue is not empty. Replacing
shouldTriggerMessageQueueDispatch = messageQueue.isEmpty();
shouldTriggerMessageQueueDispatch = (messageQueue.size() % 16) == 0;
fixes the issue, but of course there is probably something better to fix in the InternalMessageQueue.