TheJacksonLaboratory / PhenopacketLab

An Angular/Springboot web application for the loading, editing, saving of data that follows the Phenopacket Schema
BSD 3-Clause "New" or "Revised" License
7 stars 1 forks source link

Initial attempts to save a persistent change do not work #277

Closed BethSundberg closed 1 year ago

BethSundberg commented 1 year ago

Initial attempts to save a change do not work. Later they will work, this seems to happen with a clean sheet - I deleted all phenopackets, logged out, cleared history, and closed browser.

To reproduce: uploaded one of the example phenotypes. Added a new phenotypic feature. When I saved it I got red message that it was not saved (obviously to disk only). It does appear in the list, in this screen shot it is the last one for "alopecia".

Image

It got a 400 bad request error

Image

BethSundberg commented 1 year ago

I get this same error when trying to do the validation and have it save the metadata (issue 275).

BethSundberg commented 1 year ago

If I simply close my browser and re-open, everything works fine. My changes are saved. Note of course that I stayed logged on and the phenopacket is immediately shown on the screen.

belkassaby commented 1 year ago

Thanks for recreating this bug Beth! I found out the reason why : the first time around a phenopacket is uploaded to the DB, the phenopacket in question that is added on the frontend side doesnt have a db ID (the save endpoint would just return true or false instead of the entity saved). Now it is returning the entity, if no error, and therefore the corresponding dbID with it. Then when we do an update on the phenopacket uploaded we have the dbID and therefore no error 400 with an id=undefined... It was working if you would upload a phenopacket then reload the page (as then the frontend would call the get endpoint that returns a list of phenopacket that has db ID s associated with each of them.) im redeploying dev so you can test this out.

BethSundberg commented 1 year ago

It is working now.