# Relations disappear when you change tabs in MedCATTrainer

**URL:** <https://discourse.cogstack.org/t/relations-disappear-when-you-change-tabs-in-medcattrainer/280>\
**Category:** MedCAT\
**Created:** [February 15, 2024, 9:29am UTC](https://discourse.cogstack.org/t/relations-disappear-when-you-change-tabs-in-medcattrainer/280 "2024-02-15T09:29:45Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![rmmurphy](https://avatars.discourse-cdn.com/v4/letter/r/85f322/32.png) [@rmmurphy](https://discourse.cogstack.org/u/rmmurphy)\
**Post date:** [February 15, 2024, 9:29am UTC](https://discourse.cogstack.org/t/relations-disappear-when-you-change-tabs-in-medcattrainer/280/1 "2024-02-15T09:29:45Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![tomolopolis](https://avatars.discourse-cdn.com/v4/letter/t/6de8d8/32.png) [@tomolopolis](https://discourse.cogstack.org/u/tomolopolis)\
**Post date:** [February 15, 2024, 1:41pm UTC](https://discourse.cogstack.org/t/relations-disappear-when-you-change-tabs-in-medcattrainer/280/2 "2024-02-15T13:41:04Z")

</div>

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

 ![Screenshot from 2024-02-15 13-35-48](https://europe1.discourse-cdn.com/flex017/uploads/cogstack/original/1X/5ac619ebe53cf21f44f4a1cbef912c8fb2b39a77.png)

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:

 ![Screenshot from 2024-02-15 13-40-10](https://europe1.discourse-cdn.com/flex017/uploads/cogstack/original/1X/a27f2c9e2af42d05f5e7ab7d0ed5fae280946658.png)

---

<div class="post-metadata">

**Author:** ![rmmurphy](https://avatars.discourse-cdn.com/v4/letter/r/85f322/32.png) [@rmmurphy](https://discourse.cogstack.org/u/rmmurphy)\
**Post date:** [February 15, 2024, 2:44pm UTC](https://discourse.cogstack.org/t/relations-disappear-when-you-change-tabs-in-medcattrainer/280/3 "2024-02-15T14:44:55Z")

</div>

Hi Tom, no, they are confirmed concepts. In this example:  
 ![relations1](https://europe1.discourse-cdn.com/flex017/uploads/cogstack/original/1X/434beb2966d1b68973a45fd56597db34025033c6.png)  
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:  
 ![relations2](https://europe1.discourse-cdn.com/flex017/uploads/cogstack/original/1X/25a0c14bcb244d5b998bc275a8ebcecacd4b5242.png)  
which is pretty frustrating as you can imagine.

---

<div class="post-metadata">

**Author:** ![tomolopolis](https://avatars.discourse-cdn.com/v4/letter/t/6de8d8/32.png) [@tomolopolis](https://discourse.cogstack.org/u/tomolopolis)\
**Post date:** [February 15, 2024, 3:30pm UTC](https://discourse.cogstack.org/t/relations-disappear-when-you-change-tabs-in-medcattrainer/280/4 "2024-02-15T15:30:01Z")

</div>

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](https://europe1.discourse-cdn.com/flex017/uploads/cogstack/original/1X/7fc0a43e449e8f8ddd195a6b7428477e66259530.png)

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

 ![Screenshot from 2024-02-15 15-27-08](https://europe1.discourse-cdn.com/flex017/uploads/cogstack/original/1X/c7b8c4712b54759b534bb5756374766f7f547c96.png)

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

---

<div class="post-metadata">

**Author:** ![rmmurphy](https://avatars.discourse-cdn.com/v4/letter/r/85f322/32.png) [@rmmurphy](https://discourse.cogstack.org/u/rmmurphy)\
**Post date:** [February 15, 2024, 3:50pm UTC](https://discourse.cogstack.org/t/relations-disappear-when-you-change-tabs-in-medcattrainer/280/5 "2024-02-15T15:50:46Z")

</div>

You are correct!

 ![devtools relations](https://europe1.discourse-cdn.com/flex017/uploads/cogstack/original/1X/d389ae3b99e8a0b21b2d7a5c9ac5b78b66f1f6a3.png)

---

<div class="post-metadata">

**Author:** ![tomolopolis](https://avatars.discourse-cdn.com/v4/letter/t/6de8d8/32.png) [@tomolopolis](https://discourse.cogstack.org/u/tomolopolis)\
**Post date:** [February 15, 2024, 4:00pm UTC](https://discourse.cogstack.org/t/relations-disappear-when-you-change-tabs-in-medcattrainer/280/6 "2024-02-15T16:00:44Z")

</div>

great - can you screencap the payload and response tabs

---

<div class="post-metadata">

**Author:** ![rmmurphy](https://avatars.discourse-cdn.com/v4/letter/r/85f322/32.png) [@rmmurphy](https://discourse.cogstack.org/u/rmmurphy)\
**Post date:** [February 15, 2024, 4:04pm UTC](https://discourse.cogstack.org/t/relations-disappear-when-you-change-tabs-in-medcattrainer/280/7 "2024-02-15T16:04:58Z")

</div>

Sure:

 ![dev tools relations payload tab](https://europe1.discourse-cdn.com/flex017/uploads/cogstack/original/1X/2622dda443aa782307b2911dd403a2fd2fe173b0.png)  
 ![dev tools relations response tab](https://europe1.discourse-cdn.com/flex017/uploads/cogstack/original/1X/7d95f0a320bdffcca8753e9fd991db4ed7201410.png)

---

<div class="post-metadata">

**Author:** ![rmmurphy](https://avatars.discourse-cdn.com/v4/letter/r/85f322/32.png) [@rmmurphy](https://discourse.cogstack.org/u/rmmurphy)\
**Post date:** [February 15, 2024, 4:06pm UTC](https://discourse.cogstack.org/t/relations-disappear-when-you-change-tabs-in-medcattrainer/280/8 "2024-02-15T16:06:58Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![tomolopolis](https://avatars.discourse-cdn.com/v4/letter/t/6de8d8/32.png) [@tomolopolis](https://discourse.cogstack.org/u/tomolopolis)\
**Post date:** [February 15, 2024, 4:13pm UTC](https://discourse.cogstack.org/t/relations-disappear-when-you-change-tabs-in-medcattrainer/280/9 "2024-02-15T16:13:36Z")

</div>

thanks!

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?

---

<div class="post-metadata">

**Author:** ![tomolopolis](https://avatars.discourse-cdn.com/v4/letter/t/6de8d8/32.png) [@tomolopolis](https://discourse.cogstack.org/u/tomolopolis)\
**Post date:** [February 15, 2024, 4:18pm UTC](https://discourse.cogstack.org/t/relations-disappear-when-you-change-tabs-in-medcattrainer/280/10 "2024-02-15T16:18:36Z")

</div>

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 …

---

<div class="post-metadata">

**Author:** ![rmmurphy](https://avatars.discourse-cdn.com/v4/letter/r/85f322/32.png) [@rmmurphy](https://discourse.cogstack.org/u/rmmurphy)\
**Post date:** [February 16, 2024, 8:00am UTC](https://discourse.cogstack.org/t/relations-disappear-when-you-change-tabs-in-medcattrainer/280/11 "2024-02-16T08:00:08Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![tomolopolis](https://avatars.discourse-cdn.com/v4/letter/t/6de8d8/32.png) [@tomolopolis](https://discourse.cogstack.org/u/tomolopolis)\
**Post date:** [February 21, 2024, 8:20am UTC](https://discourse.cogstack.org/t/relations-disappear-when-you-change-tabs-in-medcattrainer/280/12 "2024-02-21T08:20:59Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![rmmurphy](https://avatars.discourse-cdn.com/v4/letter/r/85f322/32.png) [@rmmurphy](https://discourse.cogstack.org/u/rmmurphy)\
**Post date:** [February 21, 2024, 9:53am UTC](https://discourse.cogstack.org/t/relations-disappear-when-you-change-tabs-in-medcattrainer/280/13 "2024-02-21T09:53:48Z")

</div>

I think docker. @Tom could you confirm?

---

<div class="post-metadata">

**Author:** ![Tom](https://avatars.discourse-cdn.com/v4/letter/t/3d9bf3/32.png) [@Tom](https://discourse.cogstack.org/u/Tom)\
**Post date:** [February 21, 2024, 10:12am UTC](https://discourse.cogstack.org/t/relations-disappear-when-you-change-tabs-in-medcattrainer/280/14 "2024-02-21T10:12:45Z")

</div>

Yes, we have a docker container.
