Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

chore: files changed src/openhuman/desktop/app_state/ops_part_02.rs

Steven Enamakel10b537e59bf8
diff --git a/src/openhuman/desktop/app_state/ops_part_02.rs b/src/openhuman/desktop/app_state/ops_part_02.rs
index e082f818cd..784d28a4a7 100644
--- a/src/openhuman/desktop/app_state/ops_part_02.rs
+++ b/src/openhuman/desktop/app_state/ops_part_02.rs
@@ -62,7 +62,12 @@ async fn persist_revalidated_session_user(
token: &str,
base_metadata: BTreeMap<String, String>,
user: Value,
+ generation: u64,
) -> Result<Box<Config>, String> {
+ let _session_mutation_lock = CURRENT_USER_SESSION_MUTATION_LOCK.lock().await;
+ if current_user_generation() != generation {
+ return Err("pending session persistence became stale after sign-out".to_string());
+ }
let user_id = user_id_from_profile_payload(&user)
.ok_or_else(|| "backend user id required before clearing pending validation".to_string())?;
let workspace_env_scoped = config_is_workspace_env_scoped(config);