aodn / nrmn-application

A web application for collation, validation, and storage of all data obtained during surveys conducted by the NRMN
GNU General Public License v3.0
4 stars 3 forks source link

Feature/4804 superseded graph #1294

Closed utas-raymondng closed 1 year ago

craigrose commented 1 year ago

Since I wrote the below I have updated my database and cannot replicate it (I hadn't refreshed materialized views). Probably safe to ignore for now.

I'm getting an API error (500) when the "Save Observable Item" button is clicked after removing the "Superseded by" for species. In this example "Haliotis rubra" is superseded by "Duplicate rubra" and the "Length-Weight" has been copied.

PUT http://localhost:8080/api/v1/reference/observableItem/334

{"observableItemName":"Haliotis rubra","commonName":null,"speciesEpithet":null,"supersededBy":"","letterCode":"hal","reportGroup":null,"habitatGroups":null,"phylum":null,"class":null,"order":null,"family":null,"genus":null,"lengthWeightA":11,"lengthWeightB":22,"lengthWeightCf":33,"observableItemId":334,"obsItemTypeName":"Species","obsItemTypeId":1,"aphiaId":null,"aphiaRelTypeName":null,"supersededNames":null,"supersededIds":null,"isInvertSized":false,"obsItemAttribute":null,"hasSupersededBy":"Duplicate rubra","supersedingCleared":"Duplicate rubra"}

2023-07-06 11:44:32.243 ERROR 1157732 --- [nio-8080-exec-4] o.h.engine.jdbc.spi.SqlExceptionHelper : Batch entry 0 insert into nrmn.revinfo (timestamp, api_request_id, username, id) values (1688607872242, NULL, 'admin@utas.edu.au', 3463) was aborted: ERROR: duplicate key value violates unique constraint "revinfo_pkey" Detail: Key (id)=(3463) already exists. Call getNextException to see other errors in the batch.

utas-raymondng commented 1 year ago

@craigrose I updated the code, please take a look thanks