Skip to content

Conversation

@Ph4ntomas
Copy link
Contributor

This address a small bug where the send_message method could de-sync the server state, leading to events being sent for a stale view.

#379 addressed the issue where multiple events were sent by the server by pooling & buffering them. However, since send_message sends a new view after updating the state, it was possible to have views in-flight without the server knowledge, leading to events arriving with stale widget ids if the server sent event in the meantime.

This PR address this de-sync by having the client ask the server to request a new view instead of sending it right after updating its state.

On server side, the surface is marked with a flag forcing it to send an event, even if there are no message (if there are, no additional event is sent). This forces the server to buffer further events until a new view is received.

On client side, the program state is updated, then the request is sent. If there were no pending event, the client will receive an empty event array, and will not update a second time. If there were pending event, they will be handled normally once the previous view is applied. In that case, the client will receive the messages linked to the server-side event and update normally.

Fixes #388

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.

layer::send_message cause event desync.

1 participant