The GitHub Actions job "Required Checks" on 
texera.git/gh-readonly-queue/main/pr-8932-154042ae219f20e8bdf54a5f2312f988cc80e627
 has failed.
Run started by GitHub user mengw15 (triggered by mengw15).

Head commit for run:
e5d52e062ee7a0c148db4b6e96dcc44333917f25 / Tanishq Gandhi 
<[email protected]>
fix(frontend): show an error when a file preview fails to load, and drop a 
superseded file (#8932)

### What changes were proposed in this PR?

The file preview on dataset and model detail pages subscribed to each
file request without an error handler and never cancelled it. So:

A failed download (storage unreachable, expired link, network error)
left the preview on “File content is loading” forever.
When a file was clicked before the previous one finished, the earlier
file could arrive last and replace the newer one’s content under the
newer file’s name.

UserDatasetFileRendererComponent now keeps the current request and
cancels it whenever a new file is loaded, and shows the existing “File
loading encounter error” message when the request fails.

Before: a failed download keeps loading, and a slow earlier file
replaces the selected one:

<img width="1440" height="900" alt="before-1-download-failed"
src="https://github.com/user-attachments/assets/ca24ccb0-e721-48c1-b18d-23dffc1996dc";
/>

<img width="1440" height="900" alt="before-3-first-file-overwrites"
src="https://github.com/user-attachments/assets/3522331f-1941-42ff-bc8a-11364342837c";
/>

After: the failed download shows the error, and the selected file stays:

<img width="1440" height="900" alt="after-1-download-failed"
src="https://github.com/user-attachments/assets/6e3b9ded-910d-4d13-ae12-879918f82a4a";
/>

<img width="1440" height="900" alt="after-2-second-file-kept"
src="https://github.com/user-attachments/assets/782cf354-7963-4ebc-bdbb-4685aac03601";
/>

### Any related issues, documentation, discussions?
Closes #8930

### How was this PR tested?

Added two cases to user-dataset-file-renderer.component.spec.ts: a
failed fetch shows the loading error, and a slow file is dropped once
another file is selected. Both fail without the fix.

cd frontend
yarn ng test --watch=false
--include='**/user-dataset-file-renderer.component.spec.ts'
Tests  57 passed (57)

Also checked against a local stack: with the object store stopped,
clicking a file shows the error; and with one file’s request delayed,
clicking it and then another file keeps the second file’s content.

### Was this PR authored or co-authored using generative AI tooling?

Generated-by: Claude Code (Claude Opus 5.5)

---------

Co-authored-by: Meng Wang <[email protected]>

Report URL: https://github.com/apache/texera/actions/runs/38820810698

With regards,
GitHub Actions via GitBox

Reply via email to