When a race A gains a tech due to research treaty with race B while already in the process of researching that same tech, it does not get automatically removed. Only once the research has been completed "in-house" will the scientist move to the next item on his/her queue. This is not a big problem if playing just one race but with multiple races/nations, some in research treaties and some not, it can be messy.
Would it be possible to add a check when gaining tech through diplomacy on whether that tech is already under research and if yes, then to automatically move to the next item in queue?