Skip to content

Cache issue when creating a researcher profile multiple times after deleting #1680

@atarix83

Description

@atarix83

Describe the bug
While working on #1617 (comment) we found out a cache issue when creating a researcher profile two times. Basically the second time the profile is created we receive a remote data with status error-stale but the POST request to the server is successful (status 201).

To Reproduce
When esearcher-profile.hard-delete.enabled is set to false

  1. First, make sure researcher-profile.hard-delete.enabled = false (default value) is set on the backend
  2. Login as a user with no researcher profile (to avoid the create caching issue)
  3. Create a Researcher Profile from /profile
  4. Immediately delete it (with hard-delete disabled), this leaves the Person Entity but unlinks it.
  5. Click "Create New" again (without logging out or reloading the page or anything)
  6. The popup that shows the existing profile is displayed
  7. go to the profile suggested and try to claim it
  8. Error messages are show but POST request is successful
DSpace.Angular.__.Update.Profile.1.mp4

When esearcher-profile.hard-delete.enabled is set to true

  1. First, make sure researcher-profile.hard-delete.enabled = true is set on the backend
  2. Login as a user with no researcher profile (to avoid the create caching issue)
  3. Create a Researcher Profile from /profile
  4. Immediately delete it (with hard-delete disabled), this also delete the person item.
  5. Click "Create New" again (without logging out or reloading the page or anything)
  6. Error messages are show but POST request is successful
DSpace.Angular.__.Update.Profile.2.mp4

Expected behavior
The error messages should not be displayed

Related work
Link to any related tickets or PRs here.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions