Skip to content

fix(core): immediately unregister event listener on unlisten call - #13306

Merged
lucasfernog merged 5 commits into
devfrom
fix/unlisten-race-condition
May 5, 2025
Merged

fix(core): immediately unregister event listener on unlisten call#13306
lucasfernog merged 5 commits into
devfrom
fix/unlisten-race-condition

Conversation

@lucasfernog

Copy link
Copy Markdown
Member

the unlisten function is currently async, but marked as () => void in the TypeScript definition. To avoid a breaking change, we're going to immediately unregister the listener function so it's not called.

this fixes a race condition where after calling unlisten() you would still receive events if you do not await it and there's a new event triggering while the unlisten command is running

the unlisten function is currently async, but marked as `() => void` in the TypeScript definition. To avoid a breaking change, we're going to immediately unregister the listener function so it's not called.

this fixes a race condition where after calling unlisten() you would still receive events if you do not `await` it and there's a new event triggering while the unlisten command is running
@lucasfernog
lucasfernog requested a review from a team as a code owner April 25, 2025 12:23
@github-actions

github-actions Bot commented Apr 25, 2025

Copy link
Copy Markdown
Contributor

Package Changes Through 2fa312b

There are 6 changes which include tauri with minor, @tauri-apps/api with minor, tauri-bundler with patch, tauri-cli with patch, @tauri-apps/cli with patch, tauri-runtime-wry with patch

Planned Package Versions

The following package releases are the planned based on the context of changes in this pull request.

package current next
@tauri-apps/api 2.5.0 2.6.0
tauri-bundler 2.4.0 2.4.1
tauri-runtime-wry 2.6.0 2.6.1
tauri 2.5.1 2.6.0
@tauri-apps/cli 2.5.0 2.5.1
tauri-cli 2.5.0 2.5.1

Add another change file through the GitHub UI by following this link.


Read about change files or the docs at github.com/jbolda/covector

Legend-Master
Legend-Master previously approved these changes Apr 27, 2025

@Legend-Master Legend-Master left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Didn't test it, but code looks good

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.

2 participants