Relations disappear when you change tabs in MedCATTrainer

When I move from the Relations tab to the Concept tab and then return to the Relations tab, the relation annotations that I had made have not been saved and there are no relations listed. I am using v2.14.1.

hi @rmmurphy - thats odd. Are the relations empty or partially completed or referencing non-confirmed concepts?

If I move to the concepts tab then move back to relations nothing should disappear - so I don’t think I can replicate what you’re seeing - which sounds like a bug.

BUT - if I move away from this document, or go back to the list of projects - then I all those relations that reference a ‘grey’ concept - i.e. it has not been confirmed as correct / incorrect / alternative they will disappear. the intention here is that a relation can’t be created by an entity that hasn’t been marked by a human. So with the former screengrab I’m now seeing this when I re-load the project / document:

Hi Tom, no, they are confirmed concepts. In this example:
Both ‘contact allergie’ and ‘formaldehyde’ are manually added, as is ‘ciproxin’. Also relations 2, 3, and 4 all refer to the same entity ‘sepsis’. Regardless they all disappear when I navigate away and come back:
which is pretty frustrating as you can imagine.

okay thanks for confirming - yes I see how this is frustrating.

I can’t seem to replicate this locally or on a test instance.

Could you open chrome dev tools after adding a start and end relation annotation and see if you notice a network / server error.

So after
Screenshot from 2024-02-15 15-26-56

You’re looking for this entity-relations/ request:

In the screenshot its successful. I’m thinking these are failing on your end.

You are correct!

great - can you screencap the payload and response tabs


Just noticed that I was not logged in - could that be it?


so the last screengrab seems to indicate that the user potentially doesn’t exist. You’re not experiencing any other issues in app at all?

ah yeah that would be it! Although next question - how did you get to the page without logging in? Maybe a stale auth token somewhere …

It is actually not necessary to log in to correct annotations… in fact logging in may even reduce your access, as without logging in you can see all annotation projects, including ones that your user profile may not have permission to access. Not sure why that is but our instance is on a secure PC so it troubles me less than it otherwise would.

So this is actually a bug. You shoukd be able to access project screens without first logging in. Perhaps a stale cookie allowed login and the screen was kept open?

How is your instance of trainer deployed?

I think docker. @Tom could you confirm?

Yes, we have a docker container.