Repository navigation
fix(frontend): show an error when a file preview fails to load, and drop a superseded file - #8932
tanishqgandhi1908 wants to merge 1 commit into
Conversation
…rop a superseded file
Automated Reviewer SuggestionsBased on the
|
Backport auto-label reportThis
|
Codecov Report✅ All modified and coverable lines are covered by tests. 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
*This pull request uses carry forward flags. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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:
After: the failed download shows the error, and the selected file stays:
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)