Hello :wave::skin-tone-4: I’ve gotta a question h...
# ktor
h
Hello 👋🏽 I’ve gotta a question here which I’m not entirely sure if it relates with Coroutines or Ktor. Apologies if this is the wrong channel. Well, I’ve recently updated Kotlin  
1.4.10 -> 1.4.32
 and Ktor 
1.4.2 -> 1.5.3
 . I was definitely expecting some of Unit tests to break due to compatibility and I’ve already fixed them. However, there are still 4 of them that I’m struggling to understand what could be wrong. When one of the unit tests starts, it adds an entity to a Global Variable with type 
mutableListOf<MyModel>()
. I can confirm that the value was added successfully.  
ArrayList@XXXX
. However, when one of the routes of my Ktor server attempt to read the value from that Global Variable, it is empty and the id of the object is now 
ArrayList@YYYY
. It looks like when 
embeddedServer(…).start()
 is executed, it creates a new instance of the Global Object, hence it is empty. I’ve already tried many things, SynchronizeListOf, add the global variable into an object, but no matter what I do the reference of the GlobalObject into Ktor is always different. Would anyone be able to shed some light, please? Thanks heaps.
In case someone else also encounter a similar issue, it seems that it relates to: https://youtrack.jetbrains.com/issue/KTOR-2306