fix #14740: keep calls with pending deepscript cleanup from being discarded

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
hauke
2026-11-06 09:24:59 +01:00
co-authored by Claude Opus 5.5
parent b0da912381
commit cfde9690b2
3 changed files with 96 additions and 16 deletions
+14 -5
View File
@@ -217,13 +217,14 @@ pub async fn delete_remote_jobs(store: &Store, tr: &dyn Transcriber, id: CallId)
/// in this run, in case recording one failed). Forgets the recorded jobs
/// only if all of them were deleted, so a later run tries again.
async fn delete_jobs(store: &Store, tr: &dyn Transcriber, id: CallId, known: &[String]) {
let mut jobs: Vec<String> = match store.remote_jobs(id) {
let recorded: Vec<String> = match store.remote_jobs(id) {
Ok(jobs) => jobs.into_iter().map(|(_, remote_id)| remote_id).collect(),
Err(e) => {
log::error!("call {id}: could not read remote jobs: {e}");
Vec::new()
}
};
let mut jobs = recorded.clone();
for job in known {
if !jobs.contains(job) {
jobs.push(job.clone());
@@ -237,10 +238,18 @@ async fn delete_jobs(store: &Store, tr: &dyn Transcriber, id: CallId, known: &[S
for job in &jobs {
if let Err(e) = tr.delete(job).await {
all_deleted = false;
log::warn!(
"call {id}: deleting remote job {job} failed: {}",
e.user_message()
);
if recorded.contains(job) {
log::warn!(
"call {id}: deleting remote job {job} failed: {}",
e.user_message()
);
} else {
// Not on record: nothing will try again.
log::error!(
"call {id}: deleting unrecorded remote job {job} failed, it stays at DeepScript: {}",
e.user_message()
);
}
}
}
if all_deleted {