Monday 20 August 2012

Final end of GSoC 2012

Today is firm "pencils down" date, so it's time for summary of work done in last 3 months. I learned a lot during this time and I hope I will be able to work on any GSoC project next year again.
As you know this summer I worked on whiteboarding feature of Swift which is XMPP based chat client. UI side wasn't very demanding and I think the hardest part was the synchronization protocol. There is no standard whiteboard protocol approved by XSF, so I needed to create my own. Remko(my mentor) wanted to use Operational Transformation to keep clients in sync. The problem was that descriptions of OT which I found didn't covered everything. I needed to find own universal method to compute relevant operations for different situations. It took me a while to understand everything and implement it, but final whiteboard works quite nice thanks to that algorithm.  Whole protocol has been implemented in Swiften library, so it could be easily reused in other clients using this library. At this time only one-to-one sessions are supported, but I will try make it work with MUCs after GSoC. I will also have to finish up my XEP, which so far contains descriptions of 4 situations and general way of computing relevant operations.

Monday 13 August 2012

Suggested pencils down time

Last week I worked a little with XEP describing my protocol and then I focused on changes changes proposed by Remko. I changed texts informing about session status, added button to cancel whiteboard request, added "Opened whiteboards" section to chats tab(which allows to see opened whiteboard chats and bring it up), added handling of sessions where one side goes offline, reorganized a little session handling code, "ifdefed" whiteboard code to include it only if experimental flag is set, finally added eraser icon and modified UI a little. At the end of the week I rebased my branch on master and did some final touches according to Remko's comments. He said that he suspects that whiteboard can be integrated quite soon after GSoC pencils down under experimental.

Sunday 5 August 2012

Final preparations

This week I implemented last missing functionality which is moving of elements up and down. I modified existing "update" operation so it now has newPos field. I tried to use as few as possible operations because of amount of transformation functions(They has to handle every combination). Besides that I also added some small fixes and started writing the XEP describing protocol which I've created. Its XML format is quite simple so it doesn't need much description, but whole protocol is largely based on on operational transformation algorithm which needs detailed description about how to handle specific situations.

Sunday 29 July 2012

Minor improvements

This week I added option to modify brush and pen of selected element. I also added support for delete operation of the same element on both sides and combination of delete and update. I had a problems with bug which caused weird behaviour when I repeated several times delete and update operations of the same element, but I fixed that already and everything is working fine now as you can see here: http://www.youtube.com/watch?v=0_dta0JjPlI . I still need to implement moving of elements up and down and add some small fixes but whiteboard is almost ready.

Saturday 21 July 2012

Supplying transformation functions

This week I continued to work with synchronization protocol. I still needed to handle operations such as delete and update. Because of the versatility of the client and server class I had to provide only appropriate transformation functions. By adding these operations I could add ability to modify(move, change line width, change colours) and delete elements. The protocol is almost ready for now, but I still have to consider few more situations(such as the same element deleted on both sides).

Sunday 15 July 2012

Continuation of working with OT

This week I continued to work on class handling client side of OT. I was afraid that it will be hard to compute all weird situations, but it turned out to be quite easy. Everything is based on "bridge" of operations. New local operations are added to it's back and all incoming server operations should be transformed against all "bridge" operations, which as result gives new bridge and transformed operation which could be applied on local side. My transformation function is quite easy for now and it is able to compute only insert operations. I will have to extend it to handle also element updates and removes. At the end of the week I combined actual whiteboard with classes handling synchronization and I think it works quite well, both whiteboards are the same after putting little mess on them. Here is screencast presenting this: http://www.youtube.com/watch?v=Ep2YFX39PJk

Sunday 8 July 2012

Working on Operational Transformation

This week I worked on server and client side classes handling Operational Transformation algorithm. I will use them to keep whiteboard between clients in sync. Client and server are just roles assigned to clients and there will be no real server. I am using algorithm similar to this used in Google Wave and I am basing on this description: http://www.codecommit.com/blog/java/understanding-and-applying-operational-transformation. Server side is quite easy to implement because it takes care only for own operations and operations which are parented somewhere in it's history(it's easy to compute adequate operation to append to the end of history). Because of that it has to store only history of own operations. Client class is more complex. It has to take care of own and has to compute appropriate server operations(which anyway are computed in transformation function during computation of client version operations). So far I have created server with it's unit tests and client which is able to resolve such situation. Next week I will try to expand client class to handle more complicated operations.