Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Opening the simple item page of a withdrawn item when logged in as administrator stalls the frontend instance #3393

Closed
MW3000 opened this issue Oct 9, 2024 · 13 comments · Fixed by #3585
Assignees
Labels
affects: main Issue impacts "main" (latest release). affects: 8.x Issue impacts 8.x releases bug claimed: Atmire Atmire team is working on this issue & will contribute back component: Item (Archived) Item display or editing high priority
Milestone

Comments

@MW3000
Copy link
Contributor

MW3000 commented Oct 9, 2024

Describe the bug

In DSpace 8.x, opening the simple item page of a withdrawn item when logged in as administrator stalls the frontend instance for about 10 to 15 minutes, making it unresponsive, then continues to display the simple item page.

To Reproduce

Steps to reproduce the behavior:

  1. Login as an administrator
  2. Withdraw an item
  3. Go the withdrawn item's simple item page, eg. by clicking the item in the breadcrumbs, searching for a withdrawn item in administrative search or because you copied the url beforehand.
  4. The whole frontend instance stalls for about 10 to 15 minutes. After that time, the simple item page is displayed.

You can easily reproduce this on the DSpace Demo Website

Expected behavior

The simple item page should come up immediately

@MW3000 MW3000 added bug needs triage New issue needs triage and/or scheduling labels Oct 9, 2024
@github-project-automation github-project-automation bot moved this to 🆕 Triage in DSpace Backlog Oct 9, 2024
@tdonohue tdonohue added high priority component: Item (Archived) Item display or editing help wanted Needs a volunteer to claim to move forward and removed needs triage New issue needs triage and/or scheduling labels Oct 9, 2024
@tdonohue tdonohue removed this from DSpace Backlog Oct 9, 2024
@tdonohue tdonohue added the affects: 8.x Issue impacts 8.x releases label Oct 9, 2024
@Leano1998
Copy link
Contributor

Hi,
I looked a bit deeper into this and figured, it might be a problem with the cache of the authorization information:

  showReinstateButton$(): Observable<boolean>  {
    const correction$ = this.correctionTypeDataService.findByItem(this.item.uuid, true).pipe(
      getFirstCompletedRemoteData(),
      map((correctionTypeRD: RemoteData<PaginatedList<CorrectionType>>) => correctionTypeRD.hasSucceeded ? correctionTypeRD.payload.page : []),
    );
    const isAdmin$ = this.authService.isAuthorized(FeatureID.AdministratorOf);
    return combineLatest([isAdmin$, correction$]).pipe(
      map(([isAdmin, correction]) => {
        return !isAdmin && correction.some((correctionType) => correctionType.topic === REQUEST_REINSTATE);
      },
      ));
  }

If I force the authService not to use the cached version, it works for me, otherwise it seems to return undefined.

    const isAdmin$ = this.authService.isAuthorized(FeatureID.AdministratorOf, undefined, undefined, false);

@alexandrevryghem
Copy link
Member

@Leano1998: The problem is most likely that the template always recreates a new Observable every time the template is rerenderd. I already have a branch with similar fixes on other places that I was going to contribute, I can add that fix to that branch too 🤷

<a *ngIf="showReinstateButton$() | async" class="btn btn-primary btn-sm" (click)="openReinstateModal()">{{ 'item.alerts.reinstate-request' | translate}}</a>

@alexandrevryghem alexandrevryghem self-assigned this Oct 10, 2024
@alexandrevryghem alexandrevryghem added the claimed: Atmire Atmire team is working on this issue & will contribute back label Oct 10, 2024
@Leano1998
Copy link
Contributor

@alexandrevryghem : Yes, I noticed this behavior in the browser console. Thank you for the adding the fix!

@tdonohue tdonohue moved this from 📋 To Do to 🏗 In Progress in DSpace 8.x and 7.6.x Maintenance Oct 10, 2024
@tdonohue tdonohue removed the help wanted Needs a volunteer to claim to move forward label Oct 10, 2024
@alanorth
Copy link
Contributor

alanorth commented Oct 14, 2024

Interesting... I haven't noticed this on DSpace 7.6.x. We have many withdrawn items so I would have definitely run into this.

@alexandrevryghem
Copy link
Member

Indeed, only dspace-8_x and main are affected since this originates from this PR, which hasn't been backported to dspace-7_x.

@tdonohue tdonohue added the affects: main Issue impacts "main" (latest release). label Oct 14, 2024
@alanorth
Copy link
Contributor

alanorth commented Nov 4, 2024

I know that I said 7.6.x wasn't affected, but a comment on Slack regarding thumbnails reminded me that we do seem to have some glitch with withdrawn items as well. See this video:

Screencast.From.2024-11-04.15-58-11.webm

This item has a thumbnail in its THUMBNAIL bundle and I am logged in as an administrator. I see the spinning indicator for the thumbnail, and in the console I see an HTTP 401 for the content. Interestingly, when I move the cursor over the "edit item" button the placeholder appears. Sometimes I see the thumbnail appear, though I can't figure out the sequence of events to reproduce it.

@alexandrevryghem
Copy link
Member

@alanorth: This makes me think of an old fix that I made once but haven't contributed yet, could you try testing if this fix fixes your issue. It has been in my backlog for a while so I'm not 100% sure if it's even necessary anymore 😅

@saschaszott
Copy link
Contributor

This bug could be related to the bug described in issue #3584.

@MW3000
Copy link
Contributor Author

MW3000 commented Nov 27, 2024

Can we reopen this issue? It is still a bug in the latest DSpace 8.1-Snapshot and it affects current DSpace 8 users.

@MW3000 MW3000 reopened this Nov 27, 2024
@github-project-automation github-project-automation bot moved this from ✅ Done to 🏗 In Progress in DSpace 8.x and 7.6.x Maintenance Nov 27, 2024
@alexandrevryghem
Copy link
Member

@MW3000: Are you sure it's related to opening an item page of withdrawn item and not simply this issue: #3584

@MW3000
Copy link
Contributor Author

MW3000 commented Nov 28, 2024

@alexandrevryghem It might be related to #3584. But I just read above, it is marked as completed by #3585, which is not ported yet to DSpace 8?

tdonohue closed this as completed in #3585 [2 weeks ago]

As the bugreport was for DSpace 8 and our users are still experiencing the bug, I thought it would be good to have the issue open until fixed in DSpace 8?

@tdonohue
Copy link
Member

tdonohue commented Dec 2, 2024

@MW3000 : Closing this again as it's fixed in the codebase (for 9.0)... once a bug is fixed, the linked bug ticket will auto-close as this is an indication to developers that it's been verified to be fixed (but it still may not yet be released, obviously).

However, I've added a reminder to @alexandrevryghem on #3585 that we need to backport it to both dspace-8_x (and dspace-7_x if applicable). So, this bug will be fixed in 8.x as well, but it still requires (manual) backporting.

@alexandrevryghem if you can find time to backport this sooner (rather than later), I'd appreciate it. I can gladly review, and perhaps @MW3000 can help us to test the backport. We need to include this fix in 8.1.

@MW3000
Copy link
Contributor Author

MW3000 commented Dec 17, 2024

@tdonohue I did test the port to 8.x #3738 and left a comment.

@tdonohue tdonohue modified the milestones: 9.0, 7.6.3 Dec 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects: main Issue impacts "main" (latest release). affects: 8.x Issue impacts 8.x releases bug claimed: Atmire Atmire team is working on this issue & will contribute back component: Item (Archived) Item display or editing high priority
Projects
Development

Successfully merging a pull request may close this issue.

6 participants