Tracking changes relative to a node

I created a function which tracks who wrote what on the canvas. I add the userId to the Step before dispatching it or when receiving it from the server and later on the function uses that information to do the tracking: https://github.com/FelipeTaiarol/ProseMirror-Author-Tracking/blob/master/index.ts The code was based on the tracking example: https://github.com/ProseMirror/website/blob/master/pages/examples/track/example.js

Everything works fine but now I would like to track the position relative to a given node instead of using the absolute position. The reason for that is that I want to be able to move that node around without overriding the tracking information.

If I use the absolute position when I move the node around the absolute position changes so the tracking information is lost, if the tracking information was relative to the node I am moving I think everything would work.

Does anybody know how I could make it work ?

giving some more context, by moving a node I mean this:

private moveSectionDown(sectionNodes: CanvasSection[], index: number){
    const sectionToMove = sectionNodes[index];
    const sectionBelow = sectionNodes[index + 1];

    const moveTransaction = this.currentCanvasState.tr.insert(sectionBelow.endPos, sectionToMove.node).delete(sectionToMove.startPos, sectionToMove.endPos);
    this.dispatchTransactionToCanvas(moveTransaction);
}

When this code executes the tracking function will say that everything within ‘sectionToMove’ was created by the user who moved that section and that is not correct.