fix(profile): recover interrupted subscription refreshes

Recover pending redo at startup, coordinate profile readers and writers, and publish Draft state only after persistence. Keep the Windows legacy path by default.
This commit is contained in:
Tunglies
2026-11-30 18:44:12 +08:00
parent 0415133c88
commit 2c8b532f68
22 changed files with 1465 additions and 172 deletions
+6 -1
View File
@@ -470,7 +470,8 @@ async fn initialize_config_files() -> Result<()> {
logging!(info, Type::Setup, "Created verge config at {:?}", path);
}
if let Ok(path) = dirs::profiles_path()
if crate::config::profile_storage::check().is_ok()
&& let Ok(path) = dirs::profiles_path()
&& !path.exists()
{
let template = IProfiles::default();
@@ -489,6 +490,10 @@ async fn initialize_config_files() -> Result<()> {
/// Initializes configuration required before Tauri setup.
pub async fn init_config() -> Result<()> {
if let Err(error) = crate::config::profile_storage::recover_at_startup().await {
logging!(error, Type::Config, "Profile recovery failed: {error:#}");
}
#[cfg(target_os = "macos")]
migrate_legacy_macos_logs().await?;