Skip to content

feat: XState worker rewrite + portless stability

Choose a tag to compare

@beastyrabbit beastyrabbit released this 28 Feb 15:40
· 252 commits to main since this release
3443a73

Summary

  • Migrate backend worker orchestration to an XState actor architecture (supervisor/playlist/song runtime) while preserving existing external HTTP and WebSocket APIs.
  • Replace queue/runtime internals with actor-style behavior for clearer scheduling, better cancellation, and safer diagnostics.
  • Improve portless/local environment stability for cover assets and API URL handling.
  • Fix runtime regressions in song actor handoff and queue cancellation paths.

What's New

  • Worker runtime now uses a unified actor-driven lifecycle for songs and playlists.
  • Queue behavior is aligned with actor model expectations, including cancellation and retry-safe transitions.
  • /covers proxy in frontend dev config now uses the active API target from runtime config.
  • VITE_API_URL handling in portless web startup now supports both env-file and runtime env values.
  • Song actor cancellation path now avoids stale actor stop races when run() is re-entered.
  • Diagnostics event pipeline includes tighter runtime lifecycle handling.

Detailed Changes

  • apps/server/src/worker/runtime/actor-runtime.ts: event-loop and snapshot bookkeeping refinements for safer supervisor behavior.
  • apps/server/src/worker/song-worker.ts: safer song actor handoff and cancellation semantics.
  • apps/web/vite.config.ts: host-aware /covers proxy target and robust env fallback.
  • apps/server/src/index.ts, package.json, pnpm-lock.yaml, AGENTS.md, README.md: supporting runtime/config/docs updates.

Validation

  • pnpm check
  • pnpm -r test
  • pnpm -r typecheck
  • pnpm react:doctor