From f73c4c0071bb37430cbf48f7e2d06dcdedb2c8ec Mon Sep 17 00:00:00 2001 From: 魏曹先生 <1992414357@qq.com> Date: Mon, 17 Nov 2025 20:29:27 +0800 Subject: Use member-specific paths for latest info files --- crates/vcs_actions/src/actions/local_actions.rs | 31 +++++++++++++++------- .../src/actions/virtual_file_actions.rs | 2 +- 2 files changed, 23 insertions(+), 10 deletions(-) (limited to 'crates/vcs_actions') diff --git a/crates/vcs_actions/src/actions/local_actions.rs b/crates/vcs_actions/src/actions/local_actions.rs index c9e5db3..d10c317 100644 --- a/crates/vcs_actions/src/actions/local_actions.rs +++ b/crates/vcs_actions/src/actions/local_actions.rs @@ -1,9 +1,4 @@ -use std::{ - collections::HashMap, - io::{Error, ErrorKind}, - net::SocketAddr, - path::PathBuf, -}; +use std::{collections::HashMap, io::ErrorKind, net::SocketAddr, path::PathBuf}; use action_system::{action::ActionContext, macros::action_gen}; use cfg_file::config::ConfigFile; @@ -191,13 +186,18 @@ pub async fn update_to_latest_info_action( } if ctx.is_proc_on_local() { + let workspace = try_get_local_workspace(&ctx)?; let mut latest_info = instance .lock() .await .read_large_msgpack::(512 as u16) .await?; latest_info.update_instant = Some(Instant::now()); - LatestInfo::write(&latest_info).await?; + LatestInfo::write_to( + &latest_info, + LatestInfo::latest_info_path(workspace.local_path(), &member_id), + ) + .await?; } } @@ -206,7 +206,13 @@ pub async fn update_to_latest_info_action( // Sync Remote Sheets { if ctx.is_proc_on_local() { - let Ok(latest_info) = LatestInfo::read().await else { + let workspace = try_get_local_workspace(&ctx)?; + let Ok(latest_info) = LatestInfo::read_from(LatestInfo::latest_info_path( + workspace.local_path(), + &member_id, + )) + .await + else { return Err(TcpTargetError::NotFound( "Latest info not found.".to_string(), )); @@ -301,7 +307,14 @@ pub async fn update_to_latest_info_action( // Sync Held Info { if ctx.is_proc_on_local() { - let Ok(latest_info) = LatestInfo::read().await else { + let workspace = try_get_local_workspace(&ctx)?; + + let Ok(latest_info) = LatestInfo::read_from(LatestInfo::latest_info_path( + workspace.local_path(), + &member_id, + )) + .await + else { return Err(TcpTargetError::NotFound( "Latest info not found.".to_string(), )); diff --git a/crates/vcs_actions/src/actions/virtual_file_actions.rs b/crates/vcs_actions/src/actions/virtual_file_actions.rs index fa71f1b..fa74873 100644 --- a/crates/vcs_actions/src/actions/virtual_file_actions.rs +++ b/crates/vcs_actions/src/actions/virtual_file_actions.rs @@ -1,4 +1,4 @@ -use std::{collections::HashSet, path::PathBuf, sync::Arc, time::SystemTime}; +use std::{collections::HashSet, path::PathBuf, sync::Arc}; use action_system::{action::ActionContext, macros::action_gen}; use cfg_file::config::ConfigFile; -- cgit