Skip to content

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

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

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

Conversation

@lucasfernog
Copy link
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-project-automation github-project-automation bot moved this to 📬Proposal in Roadmap Apr 25, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Apr 25, 2025

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
Copy link
Contributor

@Legend-Master Legend-Master left a comment

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

@lucasfernog lucasfernog merged commit b985eaf into dev May 5, 2025
24 of 25 checks passed
@lucasfernog lucasfernog deleted the fix/unlisten-race-condition branch May 5, 2025 13:46
@github-project-automation github-project-automation bot moved this from 📬Proposal to 🔎 In audit in Roadmap May 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: 🔎 In audit

Development

Successfully merging this pull request may close these issues.

2 participants