fix: warn on failed sdk state dir removal in M_UNKNOWN_TOKEN recovery

This commit is contained in:
damocles 2026-06-04 11:29:23 +02:00 committed by mara
commit 7010d06c34

View file

@ -86,7 +86,13 @@ async fn main() -> Result<()> {
token + sdk state for re-provisioning"
);
let _ = tokio::fs::remove_file(&token_file).await;
let _ = tokio::fs::remove_dir_all(&state_dir).await;
if let Err(e) = tokio::fs::remove_dir_all(&state_dir).await {
tracing::warn!(
path = %state_dir.display(),
err = %e,
"failed to remove sdk state dir; next startup may fail with stale state"
);
}
return Ok(());
}
return Err(e.context("build matrix client"));