in filterRegistered of ot-server.ts, there’s this code that rewrites rename ops into add or unlink if a doc is being moved from/to somewhere not registered
case 'rename':
// rename is trickier: we want to send it untouched if the client has
// both the new and the old parent registered. Otherwise we have
// to change it either to an add or to an unlink
if (registeredDocIds[op.oldParentId] &&
registeredDocIds[op.newParentId]) {
filteredOpList.ops.push(op);
}
else if (registeredDocIds[op.oldParentId]) {
filteredOpList.ops.push({
type: 'unlink',
docId: op.docId
});
}
else if (registeredDocIds[op.newParentId]) {
filteredOpList.ops.push({
type: 'add',
docId: op.docId,
name: op.newName,
parentId: op.newParentId
});
}
break;
- the
unlinkop for moving a doc to an unregistered parent is missing theparentIdfield, which is present in normalunlinkops - the
addop for moving a doc from an unregistered parent is missing thedocTypefield, which is present in normaladdops.