-
-
Notifications
You must be signed in to change notification settings - Fork 292
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: log postmessage errors #1426
base: dev
Are you sure you want to change the base?
Conversation
Package Changes Through bb5acc2There are 1 changes which include wry with minor Planned Package VersionsThe following package releases are the planned based on the context of changes in this pull request.
Add another change file through the GitHub UI by following this link. Read about change files or the docs at github.com/jbolda/covector |
Please merge is PR, We eagerly wait to test and see if the problem is fixed. |
add this to cargo.toml [patch.crates-io]
wry = { git = "https://github.com/tauri-apps/wry", branch = "fix/postmessage-assert" } then run I think i may be alone this week and i can't merge my own PRs in this repo (nor do i want to because the tracing/debug_assertions impl i did is a bit weird) |
From this example provided from tauri-apps/tauri#10546 (comment), the error seems to be invalid window handle |
as i understood it for some the error shows up without closing windows/webviews. there's so much confusion going around in that issue though so i may have misunderstood something 🤷 but like i said, this pr is not trying to fix the actual issue just to get rid of the panic (which we should get rid of either way). |
Yeah, I agree we should get rid of this panic and log the error instead, just trying to understand why this part even gets called after both window and webview get destroyed |
i really didn't look into this at all, but we've had a similar-ish issue on macOS where we used the webview and/or tasks in the custom protocol responses even after closing the window/webview (cause we can't cancel the rust handler function). in that impl we couldn't just ignore the error so had to add a bunch of validity checks instead. i think the main trigger in tauri was the closerequested or destroyed events? idk, we did send something when closing the window |
Oh I get it now, our IPC uses custom protocol to handle message from the webview, so basically it's that we received the command through the custom protocol handler, and we handle the command, while handling it, the webview gets destroyed, and when we finished and want to send the result back, this error happens I think we should put something to indicate if the webview gets destroyed and when it happens, don't run the handler |
if the behavior is similar to what we had to deal with on macos then "don't run the handler" is not good enough because of timing issues but feel free to look into it, maybe it's better here. |
This is kinda tricky, I'm not sure if we should call |
I think we just call |
ref tauri-apps/tauri#10546
i still don't know what's happening tbh, i don't think we can realistically fill the queue. For the appWindow.close() panic i think this is just a timing issue. Anyway, panicking like this is toxic af and now we also print the error code which hopefully tells us a bit about the actual issue.