commit 649e885def5b4a6ac0ea548ec924725c88fd283b
parent 67946b369d61965f999875a7b85d3678453c382d
Author: I Mean I'm Just Saying <imeanimjustsaying@kiwifarms.st>
Date: Fri, 2 Oct 2026 01:51:38 -0400
editor: re-review R1 — the text stall is asked first, and a legacy channel is not lstat'd
The file route and the file delete ask channelTextStall (no I/O) before any
lstat, and skip the lstat on a channel with dataDir: its data/ is a link onto
the retired drive, which has no tiered links and may be known stalled.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Diffstat:
2 files changed, 32 insertions(+), 13 deletions(-)
diff --git a/editor/app/api/channels/[slug]/videos/[id]/files/[name]/route.ts b/editor/app/api/channels/[slug]/videos/[id]/files/[name]/route.ts
@@ -151,17 +151,21 @@ export async function GET(
// the corpus disk and is read directly: a stalled media drive never holds a
// transcript. (A legacy channel's whole `data/` is on its retired `dataDir`.)
const channelConfig = await readChannelConfig(paths, slug);
- const isLink = await lstat(fullPath)
- .then((l) => l.isSymbolicLink())
- .catch(() => false);
- const onMediaTier = isLink && isTierable(name);
- if (
- onMediaTier ? channelMediaStall(channelConfig) : channelTextStall(channelConfig)
- ) {
- return notAnswering();
- }
+ // THE TEXT STALL FIRST, with no I/O: on a legacy channel `data/` itself is a
+ // link onto the far drive, so even the `lstat` below would reach a drive
+ // already known not to answer (review R1).
+ if (channelTextStall(channelConfig)) return notAnswering();
const mediaDir = channelConfig?.mediaDir?.trim() || undefined;
const legacyDrive = channelConfig?.dataDir?.trim() || undefined;
+ // A legacy channel has no tiered links: its whole `data/` is on the retired
+ // drive, read through the watchdog below — no `lstat` of it here.
+ const isLink = legacyDrive
+ ? false
+ : await lstat(fullPath)
+ .then((l) => l.isSymbolicLink())
+ .catch(() => false);
+ const onMediaTier = isLink && isTierable(name);
+ if (onMediaTier && channelMediaStall(channelConfig)) return notAnswering();
const drive = onMediaTier ? mediaDir || legacyDrive : legacyDrive;
let stats;
diff --git a/editor/app/channels/[slug]/videos/[id]/videoActions.ts b/editor/app/channels/[slug]/videos/[id]/videoActions.ts
@@ -38,6 +38,7 @@ import {
} from "yt-dlp-transcript-common/controller/keepVideosMatching";
import {
ChannelMediaUnreachableError,
+ channelTextStall,
inspectChannelMedia,
} from "yt-dlp-transcript-common/lib/channelMedia";
import { onDrive } from "yt-dlp-transcript-common/lib/storageHealth";
@@ -503,12 +504,26 @@ export async function deleteVideoFileAction(
// A TIERED file's stat — a link (the `lstat`) with a tierable name — is
// asked of the media tier's drive, through its watchdog (release 17); a
// real file, `source-media.*` included, is on the corpus disk (review N7).
- const linked = await lstat(target)
- .then((l) => l.isSymbolicLink())
- .catch(() => false);
+ //
+ // A LEGACY channel (review R1) is asked nothing here: its whole `data/` is a
+ // link onto the retired drive, so the `lstat` would reach it — refused while
+ // that drive is known not to answer, and otherwise read directly as before
+ // (it has no tiered links).
+ const config = await readChannelConfig(getPaths(), slug);
+ if (channelTextStall(config)) {
+ return {
+ ok: false,
+ error: `${filename} not deleted: this channel's drive is not answering.`,
+ };
+ }
+ const linked = config?.dataDir?.trim()
+ ? false
+ : await lstat(target)
+ .then((l) => l.isSymbolicLink())
+ .catch(() => false);
const mediaDrive =
linked && isTierable(path.basename(target))
- ? (await readChannelConfig(getPaths(), slug))?.mediaDir?.trim()
+ ? config?.mediaDir?.trim()
: undefined;
let s;
try {