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
unlink
op for moving a doc to an unregistered parent is missing theparentId
field, which is present in normalunlink
ops - the
add
op for moving a doc from an unregistered parent is missing thedocType
field, which is present in normaladd
ops.