904b9b3d-c0eb-42f3-acef-958.../Sources/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
..
AppleMusicAppleScript.swift v2.0.4: latency razor — event-driven + running-app gate + parallel probing 2026-04-20 15:02:36 +08:00
ChromeWebSource.swift v2.0.4: latency razor — event-driven + running-app gate + parallel probing 2026-04-20 15:02:36 +08:00
LyricsService.swift v2.2.1: real lyrics via LRCLIB + stream envelope fix + TimelineView vinyl 2026-04-21 07:55:04 +08:00
MediaRemoteAdapterSource.swift v2.2.2: fix UI hang on plugin install — bootstrap off main queue 2026-04-21 08:05:01 +08:00
MediaRemoteSource.swift v2.0.0: full rewrite with multi-source NowPlaying 2026-04-19 02:27:21 +08:00
SpotifyAppleScript.swift v2.0.4: latency razor — event-driven + running-app gate + parallel probing 2026-04-20 15:02:36 +08:00