← Back to team overview

tomdroid-dev team mailing list archive

Re: Snowy synchronization branch

 

On Mon, Aug 24, 2009 at 11:17 AM, Benoit
Garret<benoit.garret_launchpad@xxxxxxxx> wrote:
> On Mon, Aug 24, 2009 at 3:59 PM, Sandy
> Armstrong<sanfordarmstrong@xxxxxxxxx> wrote:
>> Out of curiosity, does your web-sync branch handle server-side
>> deletes?  I'm guessing not, since a quick grep in the source code
>> indicates that you're not tracking the last sync revision.  This also
>> means that every time you sync, you are getting every single note on
>> the server.  You could save bandwidth by tracking the last sync
>> revision, and only getting note updates since that revision (this
>> would also allow you to process deletes if you wanted to).
>
> You're right, it doesn't support that at the moment. I will handle
> that as soon as I get the note guid stored in the database. There's
> still one thing I didn't quite get about the remote note deletion. The
> examples of GET requests on http://domain/api/1.0/user/notes don't
> mention note deletion. Is that an omission or should I be able to
> infer the deleted notes from the response (in that case, I don't see
> how I could do that)?

The most efficient thing to do is to make two requests for the Notes resource:

http://domain/api/1.0/sally/notes/ - Gets you all notes (without
sending content).  Since you're not creating notes in Tomdroid, any
notes in your database that aren't in that list should be deleted from
the database (if you are creating notes, look at SyncManager.cs in
Tomboy to see the way we do it - you would need to store per-note
last-sync-revision information).

http://domain/api/1.0/sally/notes/?include_notes=true&since=455 - Gets
you all new/updated notes (including content) since revision 455.
This means you need to store the last sync revision returned from
Snowy.  Note that this number is always returned by the Notes resource
(if you are authenticated).

Hope this helps,
Sandy



References