Javascript client syncronization and cloning Pivotal Tracker

Posted on 28th January, 2012 | Tagged:

Cloning Pivotal Tracker

Simple is good

At regular intervals I tend to think "There must be a better way to manage what we do on a day to day basis" which always leads to a google search "Open Source project Management".

We use "redmine" at Ylly, which is good for vaugue tasks but not usable for managing work on a daily or hourly basis. I need to note down everything that comes into my head before it is forever forgotten. I have tried the TODO list plugin but this doesn't work for tickets that last more than a week.

I recently started writing everything down in ReStructuredText format in VIM using a screened session on my server.

Extensions
==========

 - [DONE] Steelsheet - typo bigLargeSlider.html.twig

Bugs
====

 - [CANNOT REPRODUCE ON LOCAL] site_id parameter missing from route     "templates" on base site -- SOMETIMES - first time. Don't know why, doesn't     appear to be session or cache.

 - [DONE] Create new page doesnt work for original engine
 - [DONE] Export with layers > ThemeController .. getParent call to method             oin non object -- SITE ENFANT
 - [CANNOT REPRODUCE] Template includes do not work in _dev mode
 - [FIXED]  yprox:theme:restore: Always adds theme, never updates
 - [DONE] Thumbnails do not survive context transplant (context not     changed in thumbnail path .. refactor to simply generate the thumbnail path?)
 - [DONE] edit icon missing from page layout edit

This simple approach has been incredibly productive and because it is in a screened session, I can access it from any computer at anytime. Everytime I feel I have reached a milestone I simply create a new file, copying any remaining tasks from the previous file to the next. And... the milestones tend to come around every week.

Pivotal Tracker

I briefly came accross Pivotal Tracker years ago, but I only revisted it in more detail recently. It is actually exactly what I want. Unfortunately its closed source and for whatever reasons I don't like using closed source cloud applications. So, google "alternatives to pivotal tracker" and I find Falcrum.

Falcrum is infact very good. And is built as a clone of Pivotal Tracker. Its made with Ruby on Rails and I got it running in about 10 minutes or less. It is still in an early stage of development and lacks features, but it looks very promising.

But I thought ...

How hard can it be?

To build a basic clone of pivotal tracker sounds quite easy. 3 columns on a web page, a list of tasks, some jQueryUI sortable goodness and a bit of server side code to handle the data.

So I thought about it. The first "oh shit, that looks difficult" thought that came into my head was when I considered that if there were two clients modifying the same work flow, then the changes from one client should appear on the screen of the other, and vice versa. I had a few stupd ideas, like loading the entire JSON data structure from the server each time one user updated, but then I looked at the Pivotal Tracker requests, they were very lean.

The Pivotal Tracker pings the server a few times every minute. Each time the server responds with "OK" or a list of commands to effectuate the changes made by the other users. The changes are roughly as follows:

{
  'version': 12,
  'command': 'AddStory',
  'data':
    'after': 12313
    'story': {'title': 'My story', 'ownedBy': {'name': Daniel Leech [...]
}

Immediately I started thinking, so how should I do this? Visions of building the complete document structure on the server and diffing it against a cached version of the last known state of the client and then writing some crazy javascript to process the diff on the client side, things like that.

The very simple answer lies in the "version" parameter. Its actually brilliant.

Each time a user executes an action on the Pivotal Tracker story board an ajax request is sent to the server. This ajax request is logged and the ID of this log corresponds to the version above. So with this historical list of commands at our disposal the task of updating an out=of-date client becomes remarkably simple.

The client is on version "5" the latest version on the server is version "10":: Find all the commands logged from version 5 to version 10 and send them to the client to be processed in bulk.

Easy :)

Comments

Be the first to leave a comment.

Post new comment


type "i hate spam" in UPPER CASE

Tags

10 Latest Items

  • 05
    May

    blog Traveling It just occured to me that I havn't updated this website with a blog post saying that I am now on my big bike tour. I left at the end of February with my Dad and we rode down to Clermont Ferrand in sometimes very cold and wet conditions, to meet u...

  • 23
    Mar

    blog The Auto Route Bundle I have almost finished my first `symfony-cmf` bundle, the `RoutingAutoBundle`.

  • 04
    Mar

    blog Race Day Race Day

  • 11
    Oct

    blog FInding lost commits How many times have you done some work on some branch, which was not the right branch, only to go back to the branch you __thought__ you were working on, only to find out that your precious commit has dissapeared, where is it?

  • 02
    Sep

    blog Moving email to the console !Disclaimer -- this is a work in progress and if anything is a personal reference...

  • 18
    Aug

    blog 3 days on the Loire "Where shall I go?"

  • 15
    Jul

    blog Cycling in England and Wales and France Eurostar Bon Voyage 14 euros to St. Pancras station and train then metro to Wimbledon Park rendezvous avec mon frere and coffee in a wimbledon high-street cafĂ©. Bikes locked and not stolen. Books bought. More coffee. Dinner etc. Later left in morning e...

  • 22
    May

    blog Paris to Amsterdam: Paris to Brussels I left Paris at 6:30 in the morning reasoning that I would be able to cover the distance to Brussels in 12 hours. I felt the chill in my eyes 2 miles from my appartement and I realised I had forgotten to bring my new sunglasses. I returned to the appar...

  • 24
    Mar

    blog From blueprint to bootstrap I have just finished updating my Symfony2 <a href="http://github.com/dantleech/TrainerBundle">Trainer</a> application to use <A href="http://twitter.github.com/bootstrap/">Twitter Bootstrap</a>.

  • 14
    Feb

    blog DOMNodeList doesn't implement Traversable interface in PHPv5.3.2-1ubuntu4.14 So I have just spent about 4 hours scratching my head, then cursing at my computer as for some inexplicable reason TWIG would not iterate over my DONNodeList.