This can never work reliably because large updates (writing a very long string, or a binary blob) cannot be split into two update messages. Furthermore, splitting updates will void some of the guarantees that transactions give (changes applied within a transaction must be applied together). A third problem: while you are assembling all updates, the states in-between might not make sense or invalidate some kind of data schema. Your approach will definitely be problematic when working with the prosemirror editor binding, and possibly other applications.
The only reliable approach is to split messages into frames. There really is no significant overhead in frames, yet it has all the advantages.
If you still want to try this approach, I recommend to work with the LazyUpdateEncoder/Decoder directly. Look at some of the transformation functions to understand how to read and recreate update messages. But generally I really don’t recommend going this route.
I think this is a non-yjs problem, but how do you implement your provider? I think you could add a total and current to your response from the server, and only when it receives all updates, then put it into the ydoc.
And the second idea is every time you receive the small updates from doc.on('update'), you can keep it in your database and don’t let yjs merge them into a large update, since it cannot be split.