-
-
Notifications
You must be signed in to change notification settings - Fork 937
Desktop: Fix frontend message response dispatch #3247
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
Desktop: Fix frontend message response dispatch #3247
Conversation
Discovered that the editor handles frontend messages differently from other messages. It requires all frontend messages to be fully processed before dispatching any resulting messages. In the web frontend, this behavior happened implicitly because message dispatch is queued at the current end of the JavaScript execution queue. For the desktop frontend, I added a vector to collect all responses until the entire batch of frontend messages is handled, and then dispatch them afterwards.
This comment was marked as off-topic.
This comment was marked as off-topic.
Performance Benchmark Results
|
Issue:
When opening desktop app with auto saved documents menu bar would not update (export entry etc. disabled) until anything else triggered a menu bar update.
Debugging result:
After document select (triggered by document load) updated the menu another (outdated) menu bar update message arrived and put the menu bar in a outdated state.
The outdated message was send before Document load, but was handled after Document load.
Main issue was that desktop handles messages that are responses for frontend messages immediately. Therefore message execution order looked something like this on desktop:
Discovered that the editor handles frontend messages differently from other messages.
It requires all frontend messages to be fully processed before dispatching any resulting messages.
In the web frontend, this behavior happened implicitly because message dispatch is queued at the current end of the JavaScript execution queue.
For the desktop frontend, I added a vector to collect all responses until the entire batch of frontend messages is handled, and then dispatch them afterwards.
Also includes: