?

Log in

No account? Create an account
problems with lastsync - LiveJournal Client Discussions — LiveJournal [entries|archive|friends|userinfo]
LiveJournal Client Discussions

[ userinfo | livejournal userinfo ]
[ archive | journal archive ]

problems with lastsync [Apr. 4th, 2004|01:47 am]
LiveJournal Client Discussions

lj_clients

[fg]
halo,

i've implemented a client that uses the syncitems/lastsync routines. i read evan's code and wrote a similar implementation, popping off syncitems as they were downloaded, and looping until syncitems is empty.

my algorithm was in stuck in an infinite loop, and here i was pulling my hair out for hours thinking 'Perhaps the client is broken?'.

calling syncitems first, the server is returning an array of items, and one item in particular has the itemid 441. (testing this on my own journal)

then, following getevents through its course, the final result set has NO itemid of 441. furthermore, calling getevents with selecttype of "one" and "itemid" of 441 returns an empty result set.

if this item doesn't exist, why in the world is syncitems returning it to start with? is this a bug? what's going on?
linkReply

Comments:
[User Picture]From: fg
2004-04-04 03:55 pm (UTC)
it sounds like what this implies, then, is that if i am making an algorithm to archive entries from the server:

- i should NOT use syncitems to intially create the archive. instead i should just loop getevents (selecttype = syncitems) and keep looping with latest eventtime, until it returns 0 entries.

- after the archive is created, i should use syncitems combined with getevents (selecttype = one) to get creates/updates/deletes.
(Reply) (Parent) (Thread)
[User Picture]From: quirrc
2004-04-04 09:59 pm (UTC)
itemids are needed only to get update time for particualr entry. you store them and assign to the entries you get new with getevents/syncitems. in this case you should not care if one of ids is not used. also there is a selecttype " multiple" (check the ljprotocol.pl source)
(Reply) (Parent) (Thread)