Brad Whitaker (whitaker) wrote in lj_dev,
Brad Whitaker

LJ Friends Server project update

A few people (snej) have been asking about the new protocol modes that xb95 and I are adding for our work on brad's friends server project. We've been discussing it at length in private, but that's not very lj-like, now is it?

The plan at first was to have 3 new modes, but we eventually whittled them down into 1, it goes like this:

 - input:
    - "username"
    - "password"
    - "hpassword"
    - ... etc ...
    - "items" -> "clusterid:journalid:itemid:revid:replycount?;" .
    - "lastentry" -> "YYYY-MM-DD HH:MM:SS"
 - output
    - body of any relevant posts, the exact details of the data 
      returned aren't finalized yet, but it will be similar to getevents.

If lastentry is null, the server will return a hard refresh of the last 100 items. On the other hand, if lastentry is defined, any new entries since that last entry will be returned.

If items is defined, then it should be a list of items that we have stored in local cache. The server will compare these revision numbers to the live data and return any discrepencies. If, for example, a user edits an existing entry, it will get returned after a revision check.

Also, we are going to handle deletes somehow, but our exact method is escaping me at the moment. Perhaps we will return a flag that says "deleted" instead of content for deleted posts so that we can purge it from the local cache. (or whatever) Anyway, the "items" argument will be used sparingly in the client because we want to avoid sending out a full list of revision data upstream. We'll only do it if the user forces a hard refresh through their browser or if a certain amount of time has elapsed.

The :replycount portion of the revision data is optional, but if it exists then the server will compare the reply count to what we supply and return an updated count if necessary.

I've been discussing the details of this with brad and xb95 over the past couple of weeks. And xb95 has a test server up (though it's down at the moment?) with his current work running. However, with Christmas and New Years and everything we haven't been able to work as closely as necessary. I've been stalled a bit on the local daemon work because of lack of information about / ability to test the protocol modes, but I foresee us getting that resolved pretty soon.

Everything above is subject to change, but we're making pretty good progress. Any questions/comments/concerns? I will post again when things are a bit more finalized.


  • Post a new comment


    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded