Skip to content

GET workflow request with ID of deleted workflow item after approval of that workflow item causes 404 errorΒ #4187

@saschaszott

Description

@saschaszott

Bug Description

After clicking the Approve button on a workflow item, the frontend sends a HTTP POST request to the following API endpoint:

/server/api/workflow/claimedtasks/:workflow_item_id

This POST request successfully transitions the workflow item into an archived item (in_archive).

Immediately afterward, the frontend issues an additional HTTP GET request to:

/server/api/workflow/claimedtasks/:workflow_item_id/workflowitem?embed=item&embed=submitter

with the same workflow item ID (which no longer refers to a valid workflow item).

This GET request fails with a 404 Not Found error, as the workflow item no longer exists at this point β€” it has already been archived and removed from the workflow context.

The GET requests generates an exception in the DSpace backend as you can see in the application log:

org.dspace.app.rest.exception.DSpaceApiExceptionControllerAdvice 
An exception has occurred (status:404 exception: workflow.claimedtasks with id: workflow_item_id not found at: 
org.dspace.app.rest.RestResourceController.findRelInternal(RestResourceController.java:922))

This issue can be reproduced consistently on:

  • official DSpace demo instance (DSpace 8.1)
  • official DSpace sandbox instance (DSpace 9.0 RC)

Expected Behavior

Once a workflow item has been approved and archived, the frontend should no longer attempt to access it via the workflow endpoint.

Metadata

Metadata

Assignees

No one assigned

    Labels

    affects: 8.xIssue impacts 8.x releasesaffects: mainIssue impacts "main" (latest release).bugcomponent: workflowhelp wantedNeeds a volunteer to claim to move forwardtestathonReported by a tester during Community Testathon

    Type

    No type

    Projects

    Status

    πŸ“‹ To Do

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions