8000 The app aborts at launch: the import schedule spawns outside a Tokio runtime · Issue #311 · ynishi/asterism · GitHub
[go: up one dir, main page]

Skip to content

The app aborts at launch: the import schedule spawns outside a Tokio runtime #311

Open

Description

@ynishi

Problem

The desktop app aborts at launch. crates/asterism-ui/src-tauri/src/lib.rs calls asterism_core::application::ImportSchedule::spawn inside Tauri's setup hook. That hook runs on the main thread, outside any Tokio runtime. ImportSchedule::spawn (crates/asterism-core/src/application/import_scheduler.rs) starts its loop with a bare tokio::spawn, which panics:

crates/asterism-core/src/application/import_scheduler.rs:110:20:
there is no reactor running, must be called from the context of a Tokio 1.x runtime

The panic happens inside tao's did_finish_launching callback. It cannot unwind there, so the process aborts with SIGABRT before a window appears.

The call came in with 8f1b1cf ("Give an import an interval, and a source's wait somebody to hear it", 2026-09-14). The other async work in the same setup already goes through tauri::async_runtime (block_on for state::init, tauri::async_runtime::spawn for the serve tasks), which is why only this call fails.

Evidence

  • just ui-e2e on a branch cut from main at b8a598c: the app aborted during wdio's onPrepare, and no spec ran.
  • Launching the same e2e build directly with the same environment reproduced the abort and the panic line above.
  • Reproduced in the wdio-feature build only. just dev, just dogfood and a release build go through the same setup path, so they are expected to abort the same way, but that has not been run.
  • 8f1b1cf is contained in tag v0.1.1. Whether the published v0.1.1 download starts has not been checked.

Desired outcome

The app starts, and the import schedule's timer runs, in every build that goes through setup: dev, dogfood, release and the e2e build.

Constraints

  • The import schedule keeps its current contract: ImportSchedule::spawn is called by the serving process and by the test that proves it, and the handle stops the timer when it drops.
  • Tests that call ImportSchedule::spawn from inside a Tokio runtime keep working unchanged.
  • The fix is verified by just ui-e2e starting the app, not only by Rust tests. No Rust test drives Tauri's setup, and that is how the abort got past every gate.

Open

  • Where the runtime should be entered: at the call site (enter tauri::async_runtime's handle, or spawn through it), or inside ImportSchedule::spawn (take a tokio::runtime::Handle, as the other long-lived tasks in setup effectively do).
  • Whether a cheap gate should launch the app far enough to run setup, so a panic there fails CI instead of first showing up in ui-e2e.
  • Whether v0.1.1 needs a note or a follow-up release, once it is known whether the published download starts.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      0