Skip to content
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

feat(ipc): preserve channel message order #9070

Merged
merged 1 commit into from Mar 4, 2024

Conversation

lucasfernog
Copy link
Member

@lucasfernog lucasfernog commented Mar 4, 2024

This PR adds a mechanism to preserve message order on tauri::ipc::Channel. It uses a counter that gets sent to the JavaScript side, which processes it and keeps an internal queue if needed.

This was raised on a Discord thread aiming to enhance usability of the websocket plugin.

@lucasfernog lucasfernog requested a review from a team as a code owner March 4, 2024 19:06
@lucasfernog lucasfernog merged commit e62ca4e into dev Mar 4, 2024
25 checks passed
@lucasfernog lucasfernog deleted the feat/channel-preserve-order branch March 4, 2024 20:03
// eslint-disable-next-line security/detect-object-injection
const message = this.#pendingMessages[pendingId]
// eslint-disable-next-line security/detect-object-injection
delete this.#pendingMessages[pendingId]
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

delete is advised against for performance reasons, you might consider setting it to null instead.

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.

None yet

3 participants