Fix Android insta-crash: don't export TS bindings at runtime
Some checks failed
🏗️ Build and Test JellyTau / Run Tests (push) Failing after 2m18s
🏗️ Build and Test JellyTau / Build Android APK (push) Has been skipped
Traceability Validation / Check Requirement Traces (push) Failing after 18s

The tauri-specta `.export(...)` call ran inside run() on every debug app start
and tried to write `../src/lib/api/bindings.ts`, a path that doesn't exist on a
device — `.expect()` panicked at startup, crashing the app instantly on Android.
Bindings are generated by the `export_typescript_bindings` test instead.
This commit is contained in:
Duncan Tourolle 2026-06-20 18:36:57 +02:00
parent 731966246f
commit dc1f516da7

View File

@ -586,14 +586,12 @@ pub fn run() {
.filter_level(log::LevelFilter::Info)
.init();
// NOTE: TypeScript bindings are generated by the `export_typescript_bindings`
// test (`cargo test export_typescript_bindings`), NOT at runtime. Calling
// `.export()` here would try to write `../src/lib/api/bindings.ts` at app
// startup, which panics on devices (e.g. Android) where that path doesn't exist.
let builder = specta_builder();
// Export TypeScript bindings (types + typed invoke wrappers) in dev builds.
#[cfg(debug_assertions)]
builder
.export(specta_typescript::Typescript::default().bigint(specta_typescript::BigIntExportBehavior::Number), "../src/lib/api/bindings.ts")
.expect("Failed to export typescript bindings");
tauri::Builder::default()
.plugin(tauri_plugin_opener::init())
.plugin(tauri_plugin_os::init())