Skip to content

fix(frontend): show an error when a file preview fails to load, and drop a superseded file - #8932

Open
tanishqgandhi1908 wants to merge 1 commit into
apache:mainfrom
tanishqgandhi1908:fix/file-preview-load-errors
Open

tanishqgandhi1908 wants to merge 1 commit into
apache:mainfrom
tanishqgandhi1908:fix/file-preview-load-errors

Conversation

@tanishqgandhi1908

Copy link
Copy Markdown
Contributor

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:

before-1-download-failed before-3-first-file-overwrites

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

after-1-download-failed after-2-second-file-kept

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)

@github-actions github-actions Bot added fix frontend Changes related to the frontend GUI labels Oct 8, 2026
@Yicong-Huang Yicong-Huang added release/v1.3 back porting to release/v1.3 release/v1.2 back porting to release/v1.2 labels Oct 8, 2026
@github-actions
github-actions Bot requested a review from mengw15 October 8, 2026 22:26
@github-actions

github-actions Bot commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

Automated Reviewer Suggestions

Based on the git blame history of the changed files, we recommend the following reviewers:

  • Contributors with relevant context: @carloea2, @aglinxinyuan
    You can notify them by mentioning @carloea2, @aglinxinyuan in a comment.

@github-actions
github-actions Bot requested a review from xuang7 October 8, 2026 22:26
@github-actions

github-actions Bot commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

Backport auto-label report

This fix: PR was checked against each actively-supported release branch. A release/* label nominates a backport target; the branch's release manager approving this PR is what sends the fix there. The required Backport Approvals check stays red until every label below is approved, so each manager either approves or removes their own label — which is why the labels left on a merged PR are exactly the branches it reached.

Release branch Analysis
✅ release/v1.3 Change detected on this branch — label added; this fix is queued to backport here. @mengw15 decides: approving sends the fix here, removing this label declines it. The merge waits on one or the other. Review requested.
✅ release/v1.2 Change detected on this branch — label added; this fix is queued to backport here. @xuang7 decides: approving sends the fix here, removing this label declines it. The merge waits on one or the other. Review requested.

Auto-label run.

@codecov-commenter

codecov-commenter commented Oct 8, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.24%. Comparing base (be65bf8) to head (5eeff92).

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #8932      +/-   ##
============================================
+ Coverage     92.60%   93.24%   +0.63%     
  Complexity     5046     5046              
============================================
  Files          1252     1256       +4     
  Lines         53586    60394    +6808     
  Branches       6673     8325    +1652     
============================================
+ Hits          49625    56314    +6689     
- Misses         2317     2361      +44     
- Partials       1644     1719      +75     
Flag Coverage Δ *Carryforward flag
access-control-service 77.38% <ø> (ø) Carriedforward from be65bf8
agent-service 99.16% <ø> (ø) Carriedforward from be65bf8
amber 88.11% <ø> (ø) Carriedforward from be65bf8
computing-unit-managing-service 60.48% <ø> (ø) Carriedforward from be65bf8
config-service 87.37% <ø> (ø) Carriedforward from be65bf8
file-service 81.53% <ø> (ø) Carriedforward from be65bf8
frontend 96.94% <100.00%> (+0.35%) ⬆️
notebook-migration-service 83.73% <ø> (ø) Carriedforward from be65bf8
pyamber 98.52% <ø> (ø) Carriedforward from be65bf8
workflow-compiling-service 74.09% <ø> (ø) Carriedforward from be65bf8

*This pull request uses carry forward flags. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fix frontend Changes related to the frontend GUI release/v1.2 back porting to release/v1.2 release/v1.3 back porting to release/v1.3

Projects

None yet

Development

Successfully merging this pull request may close these issues.

The dataset/model file preview spins forever when a file fails to load, and can show the wrong file

3 participants