Skip to content

resolve archived item hang and false Archived badge in MyDSpace#146

Open
amadulhaxxani wants to merge 1 commit into
clarin-v7from
145-bug-one-product-in-workspace-also-showing-archived-never-ending-loading-on-view
Open

resolve archived item hang and false Archived badge in MyDSpace#146
amadulhaxxani wants to merge 1 commit into
clarin-v7from
145-bug-one-product-in-workspace-also-showing-archived-never-ending-loading-on-view

Conversation

@amadulhaxxani
Copy link
Copy Markdown

Problem description

This PR addresses two MyDSpace issues:

  1. Archived item view could hang with endless loading after a workspace-to-archived navigation sequence (first archived visit works, workspace visit works, second archived visit hangs).
  2. MyDSpace submission/workspace rows could show an incorrect "Archived" badge for non-archived items.

Console errors resolved

  • Cannot read properties of undefined (reading 'pipe') in ItemVersionsNoticeComponent
  • Cannot read properties of undefined (reading 'createComponent') in ThemedComponent
  • Cannot read properties of undefined (reading 'uuid') in StatisticsService

Analysis

Root cause was a multi-part resolver/cache/lifecycle interaction:

  1. Workspace-linked and archived routes resolved the same item via different resolver paths with inconsistent fetch/link strategies.
  2. Cache-first behaviour plus narrower workspace-linked embeds could surface partial item data where version-dependent code expected full links.
  3. Missing defensive guards in ItemVersionsNoticeComponent and ThemedComponent caused runtime exceptions in these edge flows.
  4. Global route loading state did not clear on NavigationError.
  5. View tracking attempted emission when resolved object data was absent.
  6. Archived badge in submission list element was context-hardcoded rather than driven by the actual item.isArchived flag.

Changes

File Change
src/app/app.component.ts Added NavigationError handling to route loader reset
src/app/core/submission/resolver/submission-links-to-follow.ts Expanded submission item embeds to match item-page expectations (version, versionhistory, relationships, owningCollection, thumbnail)
src/app/core/submission/resolver/submission-object.resolver.ts Changed useCachedVersionIfAvailable to false
src/app/item-page/item.resolver.ts Changed useCachedVersionIfAvailable to false
src/app/item-page/versions/notice/item-versions-notice.component.ts Added safe fallback when item.version is absent
src/app/shared/theme-support/themed.component.ts Added guard before createComponent when vcr or themedElementContent is missing
src/app/statistics/angulartics/dspace/view-tracker-resolver.service.ts Added filter to prevent tracking emission when DSO is missing
src/app/statistics/angulartics/dspace/view-tracker-resolver.service.spec.ts Updated test to match new tracking contract
src/app/shared/object-list/.../item-search-result-list-element-submission.component.ts Check item.isArchived before showing "Archived" badge
src/app/shared/object-list/.../item-search-result-list-element-submission.component.spec.ts Updated tests for corrected badge logic

Copilot review

  • Requested review from Copilot

resolve archived item hang and false Archived badge in MyDSpace
Copilot AI review requested due to automatic review settings May 15, 2026 11:31
Copy link
Copy Markdown

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

This PR addresses MyDSpace/item-page navigation issues by reducing stale cached item data usage, adding defensive guards around missing resolved data, and correcting Archived badge display logic.

Changes:

  • Forces fresh item/submission fetches and expands submission item follow links to include item-page-related embeds.
  • Adds guards for missing version/theme/view-tracking data and clears route loading state on navigation errors.
  • Updates MyDSpace submission list badge logic and related tests.

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/app/app.component.ts Clears route loading state on NavigationError.
src/app/core/submission/resolver/submission-links-to-follow.ts Expands embedded item links for submission resolution.
src/app/core/submission/resolver/submission-object.resolver.ts Disables cache-first submission object resolution.
src/app/item-page/item.resolver.ts Disables cache-first item-page resolution.
src/app/item-page/versions/notice/item-versions-notice.component.ts Adds fallback observables when item version data is absent.
src/app/shared/theme-support/themed.component.ts Guards dynamic component creation when view/content references are missing.
src/app/statistics/angulartics/dspace/view-tracker-resolver.service.ts Skips tracking emission when resolved DSO data is missing.
src/app/statistics/angulartics/dspace/view-tracker-resolver.service.spec.ts Updates missing-DSO tracking expectation.
src/app/shared/object-list/my-dspace-result-list-element/item-search-result/item-search-result-list-element-submission.component.ts Shows Archived badge only when item.isArchived is true.
src/app/shared/object-list/my-dspace-result-list-element/item-search-result/item-search-result-list-element-submission.component.spec.ts Updates badge-context expectations.

Comment on lines +28 to 29
filter(() => !!this.getNestedProperty(routeSnapshot.data, dsoPath)),
take(1),
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.

BUG - one product in workspace also showing archived || never ending loading on VIEW

2 participants