Refresh file listings on breadcrumb navigation after bitstream upload#112
Open
amadulhaxxani wants to merge 6 commits intoclarin-v7from
Open
Refresh file listings on breadcrumb navigation after bitstream upload#112amadulhaxxani wants to merge 6 commits intoclarin-v7from
amadulhaxxani wants to merge 6 commits intoclarin-v7from
Conversation
Refresh file listings on breadcrumb navigation after bitstream upload
There was a problem hiding this comment.
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/itemHandleinputs 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. |
src/app/item-page/simple/field-components/preview-section/preview-section.component.ts
Show resolved
Hide resolved
src/app/item-page/clarin-files-section/clarin-files-section.component.ts
Show resolved
Hide resolved
src/app/item-page/bitstreams/upload/upload-bitstream.component.ts
Outdated
Show resolved
Hide resolved
src/app/item-page/bitstreams/upload/upload-bitstream.component.ts
Outdated
Show resolved
Hide resolved
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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