Skip to content

Conversation

timon-schelling
Copy link
Member

@timon-schelling timon-schelling commented Oct 2, 2025

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:

LoadDocument    - create
MenuBarUpdate 1 - create

LoadDocument - execute
 -> Response MenuBarUpdate 2 - create
 -> MenuBarUpdate 2 - execute

MenuBarUpdate 1 - execute (outdated)

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:

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.
@timon-schelling timon-schelling self-assigned this Oct 2, 2025

This comment was marked as off-topic.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant