fix: make sure file exist in find_thread_path_by_id_str_in_subdir (#10618)

This commit is contained in:
jif-oai
2026-02-04 13:01:17 +00:00
committed by GitHub
parent 38f6c6b114
commit 61aecdde66
3 changed files with 36 additions and 8 deletions

View File

@@ -104,9 +104,11 @@ async fn find_prefers_sqlite_path_by_id() {
let home = TempDir::new().unwrap();
let id = Uuid::new_v4();
let thread_id = ThreadId::from_string(&id.to_string()).unwrap();
let db_path = home
.path()
.join("sessions/2030/12/30/rollout-2030-12-30T00-00-00-db.jsonl");
let db_path = home.path().join(format!(
"sessions/2030/12/30/rollout-2030-12-30T00-00-00-{id}.jsonl"
));
std::fs::create_dir_all(db_path.parent().unwrap()).unwrap();
std::fs::write(&db_path, "").unwrap();
write_minimal_rollout_with_id(home.path(), id);
upsert_thread_metadata(home.path(), thread_id, db_path.clone()).await;