Cortex
Cortex copied to clipboard
Low: expired execution artifacts still offer a Download button that only returns 404
Impact
Low — expired execution artifacts continue to display an enabled “Download artifact” button. Clicking it predictably results in an unavailable-artifact error instead of explaining that retention has ended.
Code-path evidence
ExecutionTaskTray.tsx:439–460preserves the artifact'sexpires_attimestamp when parsing the task result.ExecutionTaskTray.tsx:403–429shows the Download button wheneveronDownloadArtifactexists. It never readsexpires_atto communicate whether the resource is still available.execution.py:335–357returns 404 whenrepository.get_artifactno longer finds an owner-scoped, retained artifact. The repository checks expiry.
Reproduction
- Render a terminal task with result
{artifact_id:"art-1",mime_type:"image/png",size:100,expires_at:"2020-01-01T00:00:00Z"}. - Actual: the tray still renders an enabled Download artifact button. Clicking it calls the backend, which responds unavailable.
- Expected: show “Artifact expired” (with expiry date) and disable or omit Download after expiry, rather than presenting a known-broken action.
Proposed fix / regression
Parse a valid expires_at, show a readable expiry label, and disable download once expired. Recheck on click/time crossing because the tray can stay mounted beyond the deadline. Keep the backend 404 as the ultimate authority. Add component tests for future expiry, past expiry, malformed/missing timestamp, and an artifact expiring while the tray is open.
Reviewed revision: e824fe2dcba0d1be127c9fff165f776186dc37e9. Deterministic view-model gap; UI test not executed.