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

Improve custom URL scheme handler robustness #1440

Merged
merged 3 commits into from
Jan 24, 2025

Conversation

UdaraJay
Copy link
Contributor

Fix for wry_web_view.rs/get_custom_task_uuid trying to access stale WryWebView.

thread 'tokio-runtime-worker' panicked at .../wry/src/wkwebview/class/wry_web_view.rs:152:10:
tried to access uninitialized instance variable

This happens sometimes when closing a WebviewWindow or calling win.close(). It causes a runtime panic and crashes the application when it occurs. Fixed by adding runtime checks to make sure webview_id and task_uuid are valid before they are used.

Potentially related: #1425.

@UdaraJay UdaraJay requested a review from a team as a code owner December 16, 2024 18:11
Copy link
Contributor

github-actions bot commented Dec 16, 2024

Package Changes Through d0faa12

There are 1 changes which include wry with minor

Planned Package Versions

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

package current next
wry 0.48.1 0.49.0

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


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

@zakhenry
Copy link

I can confirm this patch fixed a segfault in macos for me too. For me this occurred during shutdown of the application after closing windows and invoking app.run_iteration(...)

@amrbashir amrbashir requested a review from FabianLars January 22, 2025 00:25
Copy link
Member

@FabianLars FabianLars left a comment

Choose a reason for hiding this comment

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

This should be fairly safe to merge as the only logic changes are the upfront validation check (that i don't think has that much of an impact but as long as we're not hitting issues with the frequency of the mutex locks we should keep it), and the removal of the unwrap which i'm always a fan of.

The only thing i'd like to change is to bring back the removed comments.

@amrbashir amrbashir merged commit 89e9a0d into tauri-apps:dev Jan 24, 2025
12 checks passed
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.

4 participants