conflicting_record response contains nonexistent record URIs

Description

When POSTing new Agent records via the API, if a duplicate Agent is found to already exist, ASpace will respond with an error and a conflicting_record identifier. When the POSTed Agent object duplicates the name of an existing Agent, the conflicting_record identifier provides the URI of the already-existing record.

However, when the POSTed Agent differs in the name of existing Agents, but has the same Authority ID as one, ASpace returns the URI that the new record would have had. For example, if there are 100 Agents in an instance, and I POST an object with a duplicate Authority ID as /agents/people/50, the error response will provide a conflicting_record URI of /agents/people/101.

Environment

None

Activity

Show:
Patrick Galligan
April 2, 2018, 3:11 PM

Can confirm this issue and replicated with local data.

Jason Loeffler
April 12, 2018, 5:34 PM

The current error reporting does not provide useful information. Revise thrown error to explain to end-user what's happening.

Nick Butler
March 10, 2020, 11:33 AM

Is there an update on when this will be fixed, please? We’re going to be migrating from a range of legacy databases into a single ArchivesSpace instance in the next few months, and we are coming up against this issue fairly frequently in our testing.

Lora Woodford
March 19, 2020, 6:37 PM

Just to confirm, I’m working on “fixing” this, but the fix will serve merely to improve the error messaging to point the the correct conflicting record, but will not actually change the intended functionality that an agent cannot be created that has a duplicate authority ID as an existing agent.

Nick Butler
March 19, 2020, 6:43 PM

That sounds like it will resolve our issue perfectly - if we have the correct id we can choose whether to use the pre-existing version of the agent or overwrite it with a new one. Thanks very much for working on this.

Done

Assignee

Lora Woodford

Reporter

Alexander Duryee

Labels

Sprint

midMar-earlyApri

Fix versions

Affects versions

Priority

Trivial