[tomboy-list] Sync and local note deletion (again)

Cornelius Hald hald at icandy.de
Fri Jun 4 10:21:53 PDT 2010


Hi Sandy,

today I spent some more time on deleting local notes during sync. My
original approach was this:

1.) Pull new/updated notes from server
2.) Push new/updated notes to server
3.) Delete local notes that do not exist on the server
4.) Push local deletion to server (not yet implemented)

In this scenario a note that get deleted on the server and modified on
the client will be pushed to the server again. So it will reappear.

I thought this is a good solution as otherwise changes that have been
made on the client might be lost.

After some problems it turned out that U1 rejects updates to notes that
have already been deleted. It seems like U1 is keeping a history of
deleted notes. Do you know if this is by design? Is it in the spec
and/or does Snowy do the same?

Anyways, I checked with Tomboy and it looks like Tomboy is doing the
following:

1.) Pull new/updated notes from server
2.) Delete local notes that do not exist on the server
3.) Push new/updated notes to server
4.) Push local deletion to server

That means that a note that is deleted on the server will be deleted on
the client whether or not it has been edited there. That's fine for me
as well, so I changed my code to do the same thing. I'm slowly getting
to the point don't worry :) 

The first thing that happened was that my newly created notes were never
pushed to the server because they got deleted in step 2.) already. I've
then looked at the Tomboy code and I can see that you are using the
individual revision number of each note to prevent notes that were never
synced from being deleted.

So far I've managed to live without per note revision numbers and I was
quite happy with it, because I don't have to create/read/update another
file.

Now finally to the point: From what you know, is there another way to
solve this in a pure client implementation without saving individual
revision numbers? If not, are revision numbers needed or would it be
enough to simply create a list of notes that have been synced at least
once? I think that would be enough, but maybe you know of other good
uses of those revision numbers, so I thought I should ask before I
implement some more crap :)

My solution would be a text file with two sections. Once lists GUIDs of
locally deleted notes, the other of notes that have been synced at least
once.

Sorry, for the length of this mail, but I thought I should explain a bit
what I'm doing, so that you could spot other errors I might have in my
code/brain.

If you find some time, please write me your comments. It's really
fascinating how much work and though there is in Tomboy.

Thanks!
Conny





More information about the Tomboy-list mailing list