I have a CollaborativeString. I'd like to display each Collaborator's cursor position as they are editing it. I can model a cursor using an IndexReference into the string. And I can allow each Collaborator to maintain their own cursor model inside a CollaborativeMap from Collaborator IDs to cursors.
But, what happens when a Collaborator leaves? Since there's no server component, I guess the other users have to handle cleaning dead items out of the map? And what if everyone has left, and there's nobody to clean up the last one? I guess it'd have to be cleaned up by whoever joins next.
I suppose it's not so bad to have all users listening on CollaboratorLeftEvent and racing to delete the corresponding item, since deleting the same item twice shouldn't be much of a problem. Is it a problem? And then I can make another check over the list if you join and you are the first Collaborator, or every time a Collaborator joins so I don't have to worry about faulty clients messing it up.
Am I overlooking a better way of doing this?