Cursors not working in subdocuments

I’m trying to get multiple subdocuments syncing to the same provider, since Liveblocks supports that.

Unfortunately, I ran into an issue with collaborative cursors.

All my cursors across all subdocuments are writing to the same cursor field in the provider’s awareness state, and it’s causing the cursor state from one subdoc to override that for all other editors! This results in duplicated editors where all subdocs share the same cursor state, too.

I don’t know if I’m approaching this the right way as I’m new to the Yjs ecosystem and haven’t yet contributed. But I’ve forked y-prosemirror in an attempt to fix this bug, and in my tests, it seems to work.

Can someone with more experience with subdocuments help review what I did (PR here) and let me know if I’m going about this the right way?