[DURACOM-350] fix cache issue after mydspace action#4234
[DURACOM-350] fix cache issue after mydspace action#4234tdonohue merged 3 commits intoDSpace:mainfrom
Conversation
tdonohue
left a comment
There was a problem hiding this comment.
@FrancescoMolinaro : I tested this today & it fixes the described bug. However, I noticed while testing that if you switch from one MyDSpace view ("Workflow Tasks") to another ("Your submissions"), the sidebar Filters list is failing to load at times like this:
It looks like this is also occurring on our Sandbox at https://sandbox.dspace.org. So, it doesn't appear to be caused by this PR. But, is this something you think we should fix also in this PR, or should I create a new ticket?
Overall, I'm +1 this PR. Just wanted to point out this semi-related issue.
|
Hi @tdonohue , thanks for the feedback! I will look forward to your feedback and thanks again! |
|
I've discovered today that this same bug appears to impact 8.x as well (it's reproducible on demo.dspace.org). So, I've updated this PR with a UPDATE: The code modified in this PR also looks to exist in 7.x, so I wouldn't be surprised if this also needs to be ported to 7.x. I haven't verified the bug there yet though. |
tdonohue
left a comment
There was a problem hiding this comment.
👍 Thanks @FrancescoMolinaro ! I've tested this today and found this fixes both issues now. It fixes #4205, and it also fixes the issue with the sidebar filters not loading (which I previously reported).
Today I also discovered this same issue appears to impact 8.x (both #4205 and the sidebar facets issue are reproducible on demo.dspace.org), and the code looks similar in 7.x (but I haven't been able to test the behavior there yet).
|
Backport failed for Please cherry-pick the changes locally and resolve any conflicts. git fetch origin dspace-7_x
git worktree add -d .worktree/backport-4234-to-dspace-7_x origin/dspace-7_x
cd .worktree/backport-4234-to-dspace-7_x
git switch --create backport-4234-to-dspace-7_x
git cherry-pick -x e84af6ab916969442931ba4f0e0ad200008adda7 1b112dd887953946c60049d2282d1c1630666b4c 7998d2d8b98ae0fc1966111f08117a1dbf0fe056 |
|
Successfully created backport PR for |
|
While I added the |
|
Hi @tdonohue , I have checked the code on 7_x and tested the issue, I believe we don't need the backporting as on the 7_x the issue is not presente and we already have the same logic to invalidate the cache: e7302bd#diff-07b76fe42cd0fdd107c20bc0af8c1337a902a4e556f3067872c1e58f8816f719R77 . |
|
@FrancescoMolinaro : Thanks for double checking and verifying this issue isn't reproducible in 7.x. In that case, I'll remove the |
[DSC-2716] show markdown info panel in cms metadata edit Approved-by: Francesco Molinaro

References
Fixes #4205
Description
This PR fixes a cache issue that occurs after executing any reloadable action in MyDSpace.
The problem arises because we update the rendered results immediately—so the item becomes visible right away—but we don't invalidate the cache. As a result, when the same search request is triggered again (for example, by switching between configurations), the cached data causes a mismatch in the item's render type. This leads to an empty list element appearing in the DOM.
So following the same logic we have on the reload method in src/app/shared/mydspace-actions/mydspace-actions.ts, I have applied a cache invalidation happening after any of the reloadable actions in MyDSpace.
Regarding the second problem mentioned in the issue, the one describing a duplicated search result, I belive is actually a duplicated item as we can also see from the banner in the item preview:
Instructions for Reviewers
List of changes in this PR:
Added method to invalidate cache after success of reloadable action.
To reproduce:
Navigate to the "Workflow tasks" view.
Claim one of the available workflow items.
Switch to another discovery configuration.
Return to the "Workflow tasks" view.
Expectation:
The list of items is rendered correctly and the items have the correct status.
Checklist
This checklist provides a reminder of what we are going to look for when reviewing your PR. You do not need to complete this checklist prior creating your PR (draft PRs are always welcome).
However, reviewers may request that you complete any actions in this list if you have not done so. If you are unsure about an item in the checklist, don't hesitate to ask. We're here to help!
mainbranch of code (unless it is a backport or is fixing an issue specific to an older branch).npm run lintnpm run check-circ-deps)package.json), I've made sure their licenses align with the DSpace BSD License based on the Licensing of Contributions documentation.