fix: update dependencies and fix tokio runtime panic#30
fix: update dependencies and fix tokio runtime panic#30reatlat wants to merge 1 commit intoaptabase:mainfrom
Conversation
|
It may be the second change of #15 that fixed it (replacing tauri's block_on with futures' one, because any tokio-based block_on panics when called on an async thread), but let me check that this PR (which reverts the first, not second, change of that PR) doesn't break that later today. As for updating dependencies, this is not a good idea. Bumping a version from 1.0.217 to 1.0.219, or 0.9.0 to 0.9.4, is not a meaningful change as this isn't an exact version specifier, but instead it means "any 1.x.x / 0.9.x version newer than this" - the root project that depends on this library may already have a newer version resolved, and bumping the versions here just causes unnecessary churn. The other changes look good, especially the PanicHookInfo one, I remember someone else opened a PR that originally introduced the deprecated version which I found a bit sketchy |
|
I see the version bump is to fix the IPC issue: in that case, bump only the @tauri-apps/api library. |
- Replace tokio::spawn with tauri::async_runtime::spawn to fix panic when called outside of Tokio runtime context - Update deprecated PanicInfo to PanicHookInfo - Bump @tauri-apps/api to ^2.7.0 for IPC fix Fixes aptabase#22 Fixes aptabase#25
28d232d to
b9c06b2
Compare
|
Thanks for the feedback! I've updated the PR — now it only contains the actual fixes:
All unnecessary dependency bumps have been removed. I'll open a separate PR for dependency updates — I believe keeping dependencies up to date is important for security, even if semver ranges technically allow resolving newer versions. The minimum version floor still matters for projects that pin or use lockfiles. |
|
Looks good, let me test it later today. |
|
Ah, so sorry, completely forgot. Will try to remember to do it today |
|
@reatlat @cristipufu works, LGTM - haven't tested panics but I'm sure it's fine, just updating to the non-deprecated struct name |
Summary
tokio::spawnwithtauri::async_runtime::spawnPanicInfo→PanicHookInfoKey Fix
The main fix is in
src/client.rswheretokio::spawnis replaced withtauri::async_runtime::spawn. This resolves the panic:Using
tauri::async_runtime::spawnis the correct approach for Tauri plugins as it properly integrates with Tauri's managed runtime.Dependencies Updated
Rust
JavaScript
Testing
Fixes #22
Fixes #25
Supersedes #26