Saturday, June 4, 2011

Sequence of Events

A slight bit of change in the plan, now I need to use the sqlite cache in the machine to store the pending actions and events etc. So here is what happens inside calcachedcalendar.js all the sequence of events and functions that happens during the updation of items online or offline.
  • When the calendar goes offline and online
    • refresh() is called when it goes online after being offline before
    • refresh() checks if the calendar is online, then it refreshes the network calendar first then calls the onLoad event where the cachedCalendar gets created again, otherwise, it calls the synchronize method which is responsible for making the offline an online sync changes.
    • The synchronize() function, all the logic for the synchronization goes in basically the sync is between the cache stored on the machine and the network. first it takes in pending sync, does all the actions related to the pending sync and then it does ChangeLog calling the replayChangesOn method and lasting if everything fails, it goes and does the full sync, which essentially means throwing away the cache and then just downloading the changes from the network computer.
  • When an addItem, adoptItem, deleteItem call is made it first gets routed through the cachedCalendar and then is called to the uncachedCalendar.
  • mCachedCalendar pulls its information from the sqlite file. unCachedCalendar is on the network.
More details on the code changes soon!



  1. As someone who uses Lightning every day, I'm looking forward to seeing the cached calendar develop. Thanks!

  2. Hi,

    Thanks for dropping by the blog, It is really helpful for me to get user feedback and I am sure I will have an awesome time developing this application. As I am doing this for the first time, I might be insanely slow in uploading patches etc. but I assure that the work shall be completed in time =)