Hi, I’m building an ed-tech platform with collaborative features. The platform is built heavily on YJS and Tiptap. One feature we’ve been excited to attempt is where teachers can create notes and students are able to highlight and comment on notes or link from teachers’ notes back to their own summary notes.
Obviously students shouldn’t be able to see each other’s highlights, comments, etc, which means (I think) that each student needs their own copy of the tiptap YDoc saved in storage.
My thinking is that if a teacher wants to update their note, then the changes should be merged into the student’s copy of the note, but the student’s changes shouldn’t merge back to the teacher’s copy of the note. Is there a nice way to do a one-way merge? Or should I just merge the ydoc and not persist the changes to the teacher’s version in the database? Or is there a better way of structuring this whole feature? Ideally we wouldn’t have to store a copy of the note for every student, but I have no idea how else one would ‘overlay’ the student’s highlight/comment onto the existing document.
I know this is quite vague, hoping someone has done something similar or can give some advice, thanks!