Back to last year, I discovered an issue with the sync system in Squirrel 0.8.6 and the iPhone application that caused the sync to stop in some cases. I couldn’t find any fix since it was the design of the system itself that was wrong. Since the majority of users didn’t have any problem, I decided to simply work on a better engine in the development version of Squirrel. While I was working on it, Apple announced iCloud at WWDC 2011, and it clearly became the perfect replacement solution for Squirrel, with the big advantage of working over the air.
Concurrently, compatibility issues showed up with Lion, and the decision was made to rewrite most of the Mac application to fix them. Since I wouldn’t want to implement again the corrupted wifi sync system, I decided to leave Squirrel for Mac without any sync feature until the iCloud solution was ready. At that time, I didn’t expect it to take it more than a few months.
Why so long?
The first major problem I had to face was the fact that iCloud is still very new. We still have very little experience and feedback about it. It took some time for Apple to publish the necessary documentation and guidelines, making it hard for all developers to understand the correct way of setting up iCloud in our applications. So the first challenge was to implement the basics of iCloud into Squirrel, both on the Mac and iPhone applications, figuring out the best UX. We’ve come up with a simple switch in the preferences/settings of the apps.
The early versions of Lion and iOS 5 had also critical issues with iCloud, and I also had to wait for fixes to be able to work properly. In particular, my Mac would delete all the data in iCloud at each startup, making it difficult to properly test things on several days… Those issues are fixed in OS X 10.7.3 and iOS 5.1.
Since other developers have also been struggling with implementing iCloud into their own apps, I’ve decided to publish the iCloud code of Squirrel as open source. I expect to help other developers in implementing iCloud as well, so we can continue working on our different apps and figure out the solutions to the remaining issues there are.
Where are we now?
A few weeks ago, I was expecting to launch a beta test “soon”. The implementation is ready and I just needed to test it properly. I’ve been testing Squirrel with my own data for the past 3 months now, and I’ve experienced several situations where the data stopped syncing. While continuing working on the implementation details, I recently got the answer to the problems I had.
What makes a sync system good is the way it handles conflicts. iCloud sync is really great since it’s done over the air, and it only sends and receives deltas, not the whole database. It’s supposed to be very easy to implement for developers. For example the conflicts are handled in a very simple way: only the latest change is kept. It seems to be perfect, but it’s not really what we want, in particular in Squirrel.
Take the example where you and your wife would add a transaction each to the same account while your iPhones are off the network. It wouldn’t happen really often, right? But it would some times. In that case, when both devices come online, iCloud process the changes and find a conflict for this account: it has a different set of transactions on the two iPhones. Which one is correct? iCloud will just take the most recent change. If your wife added her transaction after you, your transaction is removed from the account. Not exactly what you expect. Even more problematic, your transaction isn’t deleted but has now no account, which is “illegal” in Squirrel. Hence the sync cannot continue in this situation, and your iPhone stops syncing!
This is not difficult to understand, and it’s basically the only issue I had during my testings. But it has taken 2 months to figure out the reason why iCloud stopped syncing with my data. The problem is iCloud is meant to be easy for developers, but it’s too opaque: we have no ideas about what’s going on in the background. And if you have to figure out all this by yourself, this is how an implementation can last for ages…
The beta test
This is where we are with iCloud in Squirrel for the moment. I now have good testing conditions, a better understanding of iCloud, and the last remaining issue has been identified. I still have to come up with a solution, but I’m not walking in the dark anymore.
I don’t know yet when you guys will be ready to test the Squirrel apps with iCloud, but I expect it to be before the end of the month. You can follow @squirrelapp on Twitter to be notified.

OS X Lion has just been released and many people have been asking about the compatibility issues of Squirrel, and when an update will be available.





