Admitting Your Mistakes: An iPhone Failure Story
The software industry is like no other. As members, we accept some pretty nice salaries, but not without sacrifice. We work hard hours in front of a machine with very little human interaction (even if some of us prefer that). We routinely work extra hours for free when projects slip. We ALL bring our work home with us in the form of laptops and mental baggage. (I personally can’t sleep when I have a strange bug haunting me.) And god forbid you spend some time relaxing in the evenings, you’re falling way, behind in a technology race that would put Usain Bolt to shame.
But the worst aspect is the machismo front we have to put up in order to protect ourselves from looking weak. Well. Not this blog.
This past week had me face a nightmare I’d always feared but hoped I’d never have to face. And I’d like to share this story with you because while I’d like to spend the time convincing you of my overwhelming awesomeness, I’m far from it this go around.
What Happened to Task List?
Several weeks ago I was making some additions to Task List v2.1, namely adding a calendar and some other niceties. I’d put some unpublished work into the app in the few months between it and the last release, including Pomodoro integration. I wanted to keep that stuff there, without branching, so I kept it hidden and continued on my merry way.
Everything was fine until I ran a device test. Now, when I do my device tests, I oftentimes install a new version of Task List Pro right over the one I’ve been using. It’s sort of like a guts test. If I’m too scared to threaten my own data, how can I release it to you? But a funny thing happened this time…
All my data disappeared.
When I ran it, my taks list was totally empty. Oh, my. I hadn’t prepared for it, I’m pretty confident in my iOS skills, so I was both shocked and freaked. I tried to delete the app and re-sync, but no luck. My tasks had been wiped clean. I attributed it to the lack of a mapping model for my Core Data upgrade when I did the Pomodoro upgrade. I’d forgotten to put one in, and I presumed automatic migration cleaned me out. Oh, well. Time to move on.
A few days later I submitted v2.1 and everything was fine. Then, a couple weeks later, I pushed out v2.2 which added time reminders. Task List had been gaining popularity over the time it’s been out there and I was pleased with all of the functionality it provided in what still is an easy to use app.
But a week ago today, I got a disturbing email:
just downloaded your latest update for tasklist pro and without warning it has wiped everything (about 50+ tasks plus essential notes).
Total waste of money! I shall be looking elsewhere in future!
Immediately…well, I froze. I remembered what happened when my tasks got wiped clean and suddenly one of my users had seen the same thing. I couldn’t believe it. Not only is this a scary problem for your users to be facing, but taking a couple bad steps with CoreData migrations can leave you with a confusing mish-mash of upgrade paths that can be difficult to fix. That, and the horrifying fear every one of your users is about to lose all of their tasks!!
Solving The Problem (The Easy Part)
I started looking at my migrations to diagnose the problem. I reverted to old builds, created some tasks, upgraded, and recorded the results. Indeed, the app was killing my tasks. I had trouble figuring out why, however.
Then, a funny thing happened. I reverted the build without clearing the app first and my old tasks were back! The problem turned out to be that I had accidentally renamed the SQLite store that CoreData was using to save the tasks. This occurred because I replaced my old, by-hand CoreData methods with ones from iBoost, the little augmentation library that I authored on GitHub. I’d forgotten that iBoost has its own, hardcoded SQLite filename.
So, what happened is a clean database was created and the old database was abandoned when users upgraded to v2.1. This confirmed my darkest fears: every Task List user was losing their tasks when they upgraded.
But, all was not lost. Lucky for me, those tasks are still there. Hidden away. Recoverable.
I spent hours deciding what to do. Based on my iTunes numbers, thousands of people each day were updating and presumably wiping out their tasks. Was I too late? Was the damage done? Could I get an update out in time to save any of my userbase?
I decided it was my obligation to try. If I could save even a handful of users the grief of losing their tasks, I’d do it. On top of that, I’d make an effort to restore the tasks users had already lost.
When the app starts up now, it checks for the old database and the new database. If an old database exists and a new doesn’t, the user hasn’t lost their tasks yet, so I use the old data location. If they have new tasks but no old tasks, they are a new user and unaffected by the problem. However, if they have both old tasks AND new tasks, I give them a choice. An alert is presented asking if they’d like to restore their old tasks or drop them and continue with the new tasks. Once this decision is made, everything continues as normal in Task List.
This is now live as of just an hour ago. Task List and Task List Pro v2.2.1 solve the problem.
A Week Without A Home
If you’re a iOS developer, you see that my problems are only beginning. Despite fixing the problem quite quickly, I was still at the mercy of Apple. What was worse, the fix came on a Friday, so I had a whole weekend ahead of me with no hope of review. So, I did what I was morally required to do — I pulled Task List off the App Store in every country.
I spent a week waiting for a review. Recently, I’ve seen Task List (the free version) accepted within a day or two. I was hoping for a quick turnaround this week, but it wasn’t happening. By yesterday, I was panicking. So, I tried to change my luck and added Task List to one App Store in some country I’d never heard of. (To any residents of Macau, if you updated my app and lost your tasks, my apologies!)
It may have been a coincidence, but it worked. Today my app went into review and it was finally accepted and pushed to the App Store tonight. Now I hope my users have an easy time migrating back their old tasks if they so choose. I feel like many will just continue on, especially if they’ve re-entered their tasks, but by giving them a choice it shows that I have tried to make a crummy situation right again.
My mistake won’t go unpunished. I’ll lose users who lost their faith in me. I understand. And I’ll have to play catchup in the App Store after a week of no downloads or sales. I failed myself for not realizing my error when my own tasks were wiped out.
Lessons learned. Time to move on. And hopefully this story has been one you can sympathize with.
(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)