Collab saving breaks when setting different value in different files

Hello everyone,

I have a quite extensive application that allows users to collab through different files. There’s mainly two different concepts:

Files and Preloaded Code

Preloaded Code are default values that are applied once a file is created. Those are set in the CMS.

The initial created file is index.html, this one loads properly with the values and after changing it, changing to another file and returning upon it, the changes are still reflected. So the pushUpdates is working properly.

But then upon creating another file, if it has a preloaded code set (value={streamingDoc ?? preloadedCode} on CodeMirror) then the pushUpdates runs only once and everything in the websockets stop working, so changing to another file and back to this one will always show the preloadedCode

I’d like to know how to go about debugging this, why would it break only if the value is set to either the streamingdoc (the Collab value) or the preload code value?