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

fix(linux): async custom protocol crashing sending response #1276

Merged
merged 4 commits into from
May 23, 2024

Conversation

lucasfernog
Copy link
Member

Fixes GTK may only be used from the main thread. thread 'tokio-runtime-worker' panicked at .cargo/registry/src/index.crates.io-6f17d22bba15001f/webkit2gtk-2.0.1/src/auto/uri_scheme_response.rs:26

Ref tauri-apps/tauri#9794

@lucasfernog lucasfernog requested a review from a team as a code owner May 22, 2024 11:44
if let Some(content_type) = content_type {
response.set_content_type(content_type);
}
gtk::glib::idle_add(move || {
Copy link
Member

Choose a reason for hiding this comment

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

should we use MainContext::invoke instead? seems like idle_add might wait until the loop is idle which may impact performance, also MainContext::invoke will call the closure directly if it is already on the main thread.

Copy link
Member Author

Choose a reason for hiding this comment

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

oh i'll try that

Copy link
Member Author

Choose a reason for hiding this comment

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

sorted @amrbashir

Copy link
Member Author

Choose a reason for hiding this comment

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

i knew that function existed - just couldn't find it in tao/wry

Copy link
Member

Choose a reason for hiding this comment

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

sorted @amrbashir

did you forget to push 😂?

Copy link
Member Author

Choose a reason for hiding this comment

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

🤣🤣🤣🤣 in my defense i was testing this while holding a baby

Copy link
Member

Choose a reason for hiding this comment

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

no worries, anything for the baby ❤️

Copy link
Member Author

Choose a reason for hiding this comment

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

finally pushed

@amrbashir amrbashir merged commit f089964 into dev May 23, 2024
12 checks passed
@amrbashir amrbashir deleted the fix/async-custom-protocol-linux branch May 23, 2024 01:05
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