?

Log in

No account? Create an account
small annoyance: syncitems and repeated requests - LiveJournal Client Discussions [entries|archive|friends|userinfo]
LiveJournal Client Discussions

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

small annoyance: syncitems and repeated requests [Jan. 29th, 2005|03:00 pm]
LiveJournal Client Discussions
lj_clients
[evan]
The “broken client loop” prevention is well-known to be annoying when trying to develop an offline client. I notice that, even more annoyingly, if you’re currently in the “too many repeated requests” state and you try to sync again, your current request is stored as yet another attempt before you’re rejected. This means that if I check back too soon to see if my holding period has expired, I’m getting more black marks against me.

Proposed fix: in this code in ljprotocol.pl:
            LJ::set_userprop($dbs, $u, $pname, 
                             join(‘/’, map { $_, $reqs{$_} }
                                  sort { $b <=> $a } keys %reqs));
            if ($count >= 2) {
                # 2 prior, plus this one = 3 repeated requests for same synctime.
                # their client is busted.  (doesn’t understand syncitems semantics)
                return fail($err,406);
            }

Swap the order of the “if” and the “set_userprop”.
linkReply

Comments:
[User Picture]From: theorb
2005-02-01 07:34 pm (UTC)
Also, that should be using three-argument fail to specify what the error is -- preferably including the URL to find the semantics. (Oh, and evan, ‘/’ ne '/'. I hate it that tex and friends tend to do that.)
(Reply) (Thread)
From: evan
2005-02-01 11:05 pm (UTC)
yeah, my lj client sucks :(
(Reply) (Parent) (Thread)
[User Picture]From: cryo
2005-02-01 07:46 pm (UTC)
Is this why I'm getting an occasional failure when adding or removing people from my groups and then doing a refresh of friends? It's really quite annoying since a) the client isn't broken and b) there is no way to recover from it other than redoing the add/delete again which makes it look like the client IS broken.

wtfomgbbq.
(Reply) (Thread)
[User Picture]From: marksmith
2005-02-01 07:59 pm (UTC)
Heh. That does make more sense. Committed:

http://www.livejournal.com/users/changelog/1901301.html
(Reply) (Thread)
From: evan
2005-02-01 11:05 pm (UTC)
thanks!
(Reply) (Parent) (Thread)
From: xcatch_a_starx
2005-02-05 03:41 pm (UTC)
how do u comment
(Reply) (Thread)