mirror of
https://github.com/Corfirean/coa-server-manager.git
synced 2026-11-19 19:25:56 +00:00
fix(config): an imported server gets the module config files it lacks at start and after an update
A server without a module's active file (an old repack updated by the Manager) made two modules log a 'missing property' line on every world tick. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
375be1b2c5
commit
5c21ef106d
3 files changed
+41
-3
No files matched your search
@@ -190,12 +190,15 @@ async fn run_verb(state: &AppState, id: String, verb: Verb) -> std::result::Resu
|
||||
#[tauri::command]
|
||||
async fn start_server(state: State<'_, AppState>, id: String) -> std::result::Result<DriverOutcome, UiError> {
|
||||
// Servers installed before module configs were created automatically get them now (missing files only). Imported
|
||||
// servers are never written to by the Manager outside the launcher's own start-up.
|
||||
// servers only get the module files they lack (see below); nothing they have is changed.
|
||||
if let Ok(root) = path_of(&state, &id) {
|
||||
let _ = tauri::async_runtime::spawn_blocking(move || {
|
||||
let (_, meta) = install_meta(&root)?;
|
||||
if meta.kind == coa_core::registry::InstallKind::New {
|
||||
coa_core::config::materialize_module_configs(&root)?;
|
||||
} else {
|
||||
// Imported: only the module files that are missing (a module without its file logs every setting it reads).
|
||||
let _ = coa_core::config::create_missing_module_configs(&root);
|
||||
}
|
||||
let dir = meta_dir(&root)?;
|
||||
coa_core::friends::ensure_bind(&root, &dir)?;
|
||||
|
||||
Reference in new issue
Block a user