dominictarr/crdt — pull request #21 by mbrevoort (2013-04-08 07:02:06+00:00)
Title: Proper way to delete?

I'm working through a Seaport issue where when a node disconnects, it deletes the service from the crdt set of services (this line: https://github.com/substack/seaport/blob/master/lib/seaport.js#L176 ).

However, through it deletes from the set the row still exists and it exists in the history. When I connect another node that streams and synchronizes state, these seem to be getting replayed and recognized on the new node as existing again.

Is this the proper way to delete? Just hacking around a bit I've been able to fix my issue by doing the following though I don't appreciate what the consequences of this are:

delete self.doc.rows[row.id];
delete self.doc.hist[row.id];

Note, self.doc contains the "set" I was referencing above.