From 686e6cb3593e1ea7b3f081bee27bb1cc3a9bd390 Mon Sep 17 00:00:00 2001 From: Sawyer Cutler Date: Wed, 4 Nov 2026 18:21:16 -0800 Subject: [PATCH] fix(hub): refuse a read of an attachment the person removed Removing an attachment archives it, and lists already leave it out, but a read by id still returned its content. A coordinator that kept the id from an earlier read could still quote the withdrawn file. A removed attachment now reads as not found, the same as a missing one. --- apps/hub/src/artifacts/service.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/hub/src/artifacts/service.ts b/apps/hub/src/artifacts/service.ts index 5641ce30..df08fd8d 100644 --- a/apps/hub/src/artifacts/service.ts +++ b/apps/hub/src/artifacts/service.ts @@ -1424,7 +1424,7 @@ export function createArtifactService( // readArtifact is the model-facing chunked reader (8000-character budget); // the hub serves whole documents, so it reads the stored version directly. const row = await getArtifact(db, artifactId); - if (!row || row.tenantId !== actor.tenantId) + if (!row || row.tenantId !== actor.tenantId || row.archivedAt !== null) throw new ProjectError(404, "artifact_not_found", { artifactId }); // The app by its kind is the main line; snapshots are read by their version. const resolved =