Garbage: retry a probe's apply once when a release it joins was deleted meanwhile
Test and deploy / test (push) Successful in 58s
Test and deploy / deploy (push) Successful in 1m23s

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Daan MeijerandClaude Opus 5.5 committed 2026-10-08 11:36:34 +02:00
1 parent 52fe911bcc
commit 3a60a0aa2c
1 file changed
+6 -4
+6 -4
View File
@@ -162,12 +162,14 @@ class ContentService {
try {
result = await this.applyProbe(task, probe)
} catch (error: any) {
// Another probe of the release (its first volume, its par2) deleted it as garbage meanwhile:
// what this one found has nowhere to go (LOG.md 2026-10-08 (7)).
if (error.code === '23503' && !(await db.from('files').where('id', task.fileId).select('id').first())) {
// Another probe deleted a release this one writes to as garbage meanwhile (LOG.md 2026-10-08 (7)):
// the file's own release (nothing left to do), or one its par2 set joins (once more: the set
// then finds the release's files gone and makes its own).
if (error.code !== '23503') throw error
if (!(await db.from('files').where('id', task.fileId).select('id').first())) {
return { named: 0, contentType: probe.contentType, garbage: 'deleted meanwhile' }
}
throw error
result = await this.applyProbe(task, probe)
}
result.garbage = (await GarbageFilter.afterProbe(task.fileId, probe.contentType)) ?? undefined
return result