Tuesday, July 19, 2011

Patch ported and posted!

I just posted my first patch. Phew, it has been days of reconciliations between the inverse trunk and the lightning trunk, with a number of small differences to be resolved.

But, in the end, its been a positive weekend and week so far, I managed to clone the repository once from comm-central. Spent 4 hours in trying to get all the changesets, Mozilla source has really a long long history. Started a build environment once again and got the binaries i wanted.

So the patch has been tested on TB version> 5.0 and it works nicely in the offline mode as well as the 50x server unavailability mode.

Feel free to check out the patch. Its available here https://bugzilla.mozilla.org/show_bug.cgi?id=380060

Comments will be greatly appreciated. I am looking forward to some feedback to improve the user experience in dealing with these scenarios.

Cheers
Mohit

Thursday, July 14, 2011

Porting the patch to trunk

ah, first post in a long time.

So I am in India, enjoying an awesome summer with my friends and family. Eating a lot and having loads of fun time. However, I am happy to tell you that the offline patch is now complete and just needs to be ported over to the Head branch of Lightning, once that is done, future versions of lightning will then have the ability to do all the funny offline stuff they ever wanted.

Isn't it cool?

And apart from that GSoC has reached its mid-point an evaluations are beginning to happen. More coming later.

Cheers
Mohit

Thursday, June 30, 2011

New Feature Implemented: Handling of Server Errors

Hola!

When we implemented the offline sync mechanism it occurred to us that the offline mechanism could be extended to a large number of situations and one of them is the situation where one can handle the server availability errors to a large extent.

Caldav Calendar code has been modified to allow for addition, modification and deletion of events during the case where a server is unavailable and a status message of 50x is received on the remote calendar request by lightning.

We assume that a human can't do anything about a server error, and we also assume that the server will be fixed. So this does not mean that the events u manipulate will sync remotely. They will however, sync, whenever the server comes back online.

you can find the binaries here and again these are purely for testing purposes and any bugs you can share with me via comments or mail me at: mohit.kanwal(AT)gmail.com

cheers
msk

Monday, June 20, 2011

Binaries are online *Solely for getting Test feedback*

Hi everyone,

Binaries for the different platforms are online now at https://github.com/creativepsyco/Lightning-1.0-b2-Offline-Sync-Binaries . If you have an interest in helping me test out the Offline Sync feature you can go ahead, download the xpi file appropriate to your system and try out thunderbird with the offline sync enabled lightning. Or if you are just curious what this version of lightning can do create a dev profile in Thunderbird and install the add-on into that profile, help on this is available here: https://developer.mozilla.org/en/setting_up_extension_development_environment#Development_profile

I must stress that things may break, and when they do break, send me an email at mohit.kanwal(AT)gmail.com or  file an issue in github, I will then get in touch with you regarding the cause of the issue and sort it out.

So yeah, go ahead and give it a try. You would need a stable build of Thunderbird to use with the binary...

Looking forward to some feedback :-)

cheers
msk

And We are Getting There

Life's been pretty busy these days. Packing, Packing and only packing. Work on the offline feature is now edging closer and closer to testing phase. Bugs are being discovered everyday and fixed on a regular basis now.

The current state of the project allows a user to :-

  • Edit, Delete and Create events offline and sync them back online
  • Modify recurring events offline and sync them back online
  • Handlers to detect cases when syncing is not possible if network connection is severed.
  • Syncing the calendars on the loading
  • Same handling for the Todos as well
The next set of items I am working on are:-
  • Create a switching code that detects if additions, deletions etc are failing so that it can put the calendar in offline mode 
  • Reconcile these items whenever calendar can be reached.
The above 2 are not even present in Apple iCal so this gives me a feeling that I am doing something new. I have not looked inside the new Lion OSX so I can't say that they have implemented this already, but lets see how this feature works. 

PS: If anyone is interested in testing the offline syncing features, then drop me a comment and i will host the xpi files somewhere. Or if you guys have any ideas that you wish to see in the feature let me know. Your feedback would be really really valued and appreciated, and plus I wish to stress that many many things might break if you are using a test version of Offline sync, so please don't use it for the real events.

Cheers
msk

Thursday, June 16, 2011

Step 1: Doing offline changes to cached Events

This week a big step has been implemented and tested fully, the ability for the user to create and edit events in the offline mode. Such a step is significant since it leaves me with only to implement the sync algorithm. Wolfgang made several changes to the idl files and interfaces. The changes include:-

  • calICalendar now has flags for OFFLINE_DELETED_ITEMS and created and modified items as well which allow us to changes the behavior of getItems() accordingly.
  • There is a new interface calIOfflineStorage which defines the methods used to handle offline operations, currently only 3 methods are defined, offlineDelete, offlineAdd and offlineModify and calStorageCalendar.js which implements the backend for calIStorage interface, the basic SQLite handler for cached calendar, implements these methods. 
  • The above methods changes the offline_journal flag, which is an additional field added to the SQL table cal_events and cal_todos. As such there was a need to write an upgrade function. This made me add code inside the calStorageUpgrade.jsm module, raising the database schema version to 20 from its current level of 19. 
  • Since offline_journal is not a part of the standard calIEvent interface, there would always be hacks and workarounds all over the place since which writing and reading events, the functions inside calEvent.js and calTodos.js would destroy the sql columns of the record. For example, the modifyItem function inside calStorageCalendar.js first destroys the item in the database, then adds the new modified item. This a hack, wolfing told me and hence I must make sure that it does not screw up the offline_journal flag, hence before it actually goes ahead and deletes the item record, I get the flag and restore it when the modification has completed.
Coding wise, it all looks good and the wiki has been a life saver. Seriously without it there would be no progress at all. The next step is to get the sync in place. Steps for doing this have been outlined at http://wiki.mozilla.org/Lightning_Offline_Sync

cheers
msk

Wednesday, June 8, 2011

A New Turnaround

Yay, the project is going full steam now.

Wolfgang from Inverse and a contributor on a number of bugs in the calendar project has joined and is now directly overseeing the work I do.

I had a meeting with him and Ludovic and finalised the roadmap of the feature completion. The deadline we have set is to get the feature up and running in 3 weeks, which I think would not be difficult at all. And plus wolfgang is really helpful in speeding me into writing code and committing changes.

Wolfgang has created a branch at mtn.inverse.ca and I am working on getting the methods written down, while he writes the glue that is required to get the thing running smoothly.

Awesome Days ahead.
Mohit