Skip to content

fix(tauri): cegah services_start menghancurkan container running (1.0.0-beta.4)#8

Merged
devhardiyanto merged 2 commits into
mainfrom
hotfix/service-start-preserve-running
Jul 22, 2026
Merged

fix(tauri): cegah services_start menghancurkan container running (1.0.0-beta.4)#8
devhardiyanto merged 2 commits into
mainfrom
hotfix/service-start-preserve-running

Conversation

@devhardiyanto

Copy link
Copy Markdown
Owner

What

Hotfix: mencegah services_start menghancurkan container Docker yang sedang running saat menyalakan satu service dari dashboard. Sekaligus bump versi ke 1.0.0-beta.4.

Why

Setelah boot laptop, container auto-restart (restart: unless-stopped) tampil running di dashboard, tapi flag selected di frontend belum ter-reconcile (reconcile hanya sekali di onMounted, kalah cepat dari kesiapan Docker Engine). Saat user toggle satu service (mis. SQL Server), frontend mengirim subset ["sqlserver"] ke backend. Backend regenerate compose file hanya berisi subset itu lalu up --remove-orphans → mysql/postgres/minio/redis dianggap orphan dan dihancurkan.

How

Dua perbaikan komplementer, tanpa mengubah signature command:

  • Backend safety net (services.rs): sebelum generate compose, union list yang diminta dengan container servel_ yang sedang running (helper murni union_with_running, di-cover 2 unit test). up --remove-orphans tak bisa lagi menghancurkan service running yang tidak ikut dikirim. Jika Docker belum ready → fallback pakai list apa adanya.
  • Frontend continuous reconcile (useServices.ts): applyStatusChange menandai selected=true saat container terobservasi running, menjaga selectedIds ⊇ running dan menyembuhkan config.json yang sempat ter-overwrite.

Changes

  • src-tauri/src/commands/services.rs — union guard + union_with_running + 2 test
  • src/composables/useServices.ts — reconcile kontinu di applyStatusChange
  • bump 1.0.0-beta.31.0.0-beta.4 (package.json, Cargo.toml, tauri.conf.json, lockfiles)

Verifikasi: cargo check ✓ · vue-tsc --noEmit ✓ · 56 Rust tests pass (2 baru).

devhardiyanto

services_start memakai `up --remove-orphans` dengan compose file yang
hanya berisi list dari frontend. Saat frontend mengirim subset (race
state setelah boot: reconcile sekali di mount kalah cepat dari kesiapan
Docker Engine), service running yang tak terkirim ikut ter-remove.

- backend: union list dengan container servel_ yang sedang running
  sebelum generate compose (helper union_with_running + 2 test).
- frontend: applyStatusChange jadikan container running → selected=true
  (reconcile kontinu), jaga selectedIds ⊇ running + heal config.json.

devhardiyanto
@devhardiyanto
devhardiyanto merged commit 86d4566 into main Jul 22, 2026
3 checks passed
@devhardiyanto
devhardiyanto deleted the hotfix/service-start-preserve-running branch July 22, 2026 17:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant