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.
Can confirm this issue and replicated with local data.
The current error reporting does not provide useful information. Revise thrown error to explain to end-user what's happening.
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.
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.
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.