Skip to content

Refresh file listings on breadcrumb navigation after bitstream upload#112

Open
amadulhaxxani wants to merge 6 commits intoclarin-v7from
70-item-requires-page-refresh-when-new-bitstream-is-added
Open

Refresh file listings on breadcrumb navigation after bitstream upload#112
amadulhaxxani wants to merge 6 commits intoclarin-v7from
70-item-requires-page-refresh-when-new-bitstream-is-added

Conversation

@amadulhaxxani
Copy link

Refresh file listings on breadcrumb navigation after bitstream upload

Problem description

After uploading a bitstream to an item, the file list component would not refresh when navigating back to the item page via breadcrumb. The uploaded file would not appear in the item view without a manual page refresh, because stale cached bitstream data was being returned from the metadatabitstreams byHandle endpoint.

Copilot review

  • Requested review from Copilot

Refresh file listings on breadcrumb navigation after bitstream upload
Copilot AI review requested due to automatic review settings March 12, 2026 14:50
@amadulhaxxani amadulhaxxani linked an issue Mar 12, 2026 that may be closed by this pull request
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes stale file listings after a bitstream upload when returning to the item page via breadcrumbs by forcing fresh item/bitstream-related data resolution instead of reusing cached metadatabitstreams results.

Changes:

  • Refresh preview/CLARIN file list components when their item/itemHandle inputs change (and manage subscriptions).
  • Adjust item resolution to allow re-requesting when cached responses become stale.
  • Mark relevant cached requests as stale after a successful bitstream upload, and extend unit tests.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
src/app/item-page/simple/field-components/preview-section/preview-section.component.ts Refresh bitstream listing when item input changes; adds subscription cleanup.
src/app/item-page/item.resolver.ts Enables reRequestOnStale when resolving items by ID.
src/app/item-page/clarin-files-section/clarin-files-section.component.ts Refresh CLARIN file list when item/itemHandle inputs change; adds subscription cleanup.
src/app/item-page/bitstreams/upload/upload-bitstream.component.ts Marks multiple cached requests stale after upload to force fresh data on navigation back.
src/app/item-page/bitstreams/upload/upload-bitstream.component.spec.ts Extends tests to account for additional cache-staling behavior.

Move refresh logic to ngOnChanges
Set related requests stale instead of removing cache
Use setStaleByHrefSubstring for metadatabitstreams cache
Add null checks for nested RemoteData access
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Item requires Page Refresh when new Bitstream is added

2 participants