904b9b3d-c0eb-42f3-acef-958.../Sources
徐翔宇 fbc64caec5 v2.2.2: fix UI hang on plugin install — bootstrap off main queue
Symptom: installing v2.2.1 caused Mio Island to freeze ("卡崩") on launch.
Not a true crash, just the main runloop stuck long enough to trip the
"app not responding" state.

Root cause: MediaRemoteAdapterSource.spawn() scheduled bootstrapGet()
on `DispatchQueue.main.asyncAfter(+0.3)`. bootstrapGet runs a Perl
subprocess that dlopens MediaRemoteAdapter.framework then calls
`get` — that cold path takes 500ms to 1s in the worst case. During
that entire window, `proc.waitUntilExit()` blocks the main thread.
No UI events drain, SwiftUI drops frames, window looks hung.

Fix:
- Move the `DispatchQueue.main.asyncAfter` to
  `DispatchQueue.global(qos: .userInitiated).asyncAfter` so the Perl
  cold path runs on a background queue.
- Since `currentInfo` is now mutated from both queues (bg in bootstrap,
  main in parseLine/stream), hop the merge + onUpdate back onto main
  after we parse the JSON on bg. Single writer, no data race.
- parseLine is unchanged — still runs on main via the FileHandle
  readabilityHandler hop.

Verified 30s alive, debug log shows bootstrap + stream rx both
emitting correctly.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-21 08:05:01 +08:00
..
sources v2.2.2: fix UI hang on plugin install — bootstrap off main queue 2026-04-21 08:05:01 +08:00
support v2.2.1: real lyrics via LRCLIB + stream envelope fix + TimelineView vinyl 2026-04-21 07:55:04 +08:00
ui v2.2.1: real lyrics via LRCLIB + stream envelope fix + TimelineView vinyl 2026-04-21 07:55:04 +08:00
MioPlugin.swift feat: MioIsland music player plugin — reads system NowPlaying 2026-04-11 23:37:11 +08:00
MusicPlugin.swift v2.0.3: compact panel via host size hint + Apple Music artwork + faster poll 2026-04-19 20:42:14 +08:00
NowPlayingState.swift v2.2.1: real lyrics via LRCLIB + stream envelope fix + TimelineView vinyl 2026-04-21 07:55:04 +08:00