DSpace / dspace-angular

DSpace User Interface built on Angular.io
https://wiki.lyrasis.org/display/DSDOC8x/
BSD 3-Clause "New" or "Revised" License
123 stars 394 forks source link

ngVars cause duplicate thumbnail bitstream requests #3134

Open bram-atmire opened 2 weeks ago

bram-atmire commented 2 weeks ago

Describe the bug On pages where thumbnails are requested, Angular sends 2 requests to retrieve the bitstream instead of one.

Screenshot 2024-06-18 at 14 16 19

Cause & solution approach

This is likely caused by the use of ngVars here and here

One path to address this would be to replace the occurences with their values.

To Reproduce Steps to reproduce the behavior:

  1. Open up inspect element
  2. Go to https://demo.dspace.org/search?spc.page=1&query=%22A%20Strength-Based%20Approach%20to%20Indigeneity,%20Equity,%20Diversity,%20and%20Inclusion%20Program%20Evaluation%20in%20Higher%20Education%22 this is a search that should return two items with thumbnails
  3. Check how many "content" requests there are

Expected behavior There should be 2 content requests, one per file

Observed behavior There are 2 requests per file

Related work Link to any related tickets or PRs here.

bram-atmire commented 2 weeks ago

This is affecting both 7.6.x maintenance, as well as DSpace 8

alanorth commented 2 weeks ago

Good catch, @bram-atmire! I see it on our DSpace 7.6.1 instance too, though in Firefox at least each of the second requests are cached and take 0ms.

2024-06-20T09:09:33,018418137+03:00-fs8

bram-atmire commented 3 days ago

you're right Alan, I can also see that in Chrome, if you have "Disable Cache" DISABLED (so if caching is ON) the duplicate requests are not visible.

Nevertheless, we likely still better clean up the use of ngVars anyway.