Refactor file path handling in JobThreadContext and ApiService

- Streamlined the logic for encoding new file names and paths, enhancing consistency in file operations across both JobThreadContext and ApiService.
- Improved readability by consolidating multiple lines of code into single statements, particularly in the handling of metadata file paths and script suffixes.
- Enhanced error logging for snapshot retrieval in compute_and_apply_changes, ensuring better debugging capabilities during file operations.
This commit is contained in:
Joe 2026-02-05 20:35:34 -06:00
parent e33cf7ae77
commit 9912d86896
2 changed files with 17 additions and 31 deletions

View file

@ -351,10 +351,7 @@ impl ApiService {
// Strip known script suffixes (.server, .client, etc.)
// rather than splitting on dots, so that names containing
// dots (e.g. "Config.Client.server.luau") resolve correctly.
if let Some(file_stem) = path
.file_stem()
.and_then(|s| s.to_str())
{
if let Some(file_stem) = path.file_stem().and_then(|s| s.to_str()) {
let base_name = file_stem
.strip_suffix(".server")
.or_else(|| file_stem.strip_suffix(".client"))