This morning, life imitating Music App Stuff #9, a mosquito bit me a couple of times before I killed it. I was jotting down notes for a newsletter about squashing bugs, which has been my modus operandi for the past couple of weeks. Who can say which one of us was being a little on-the-nose: the mosquito or me, using it as a way into this post? Let’s just get into it, shall we?
I’ve been putting the finishing touches on Albums 4.2.4, which is another bug fix release in the 4.2 cycle. 4.2 was buggier than the average minor version, but it was also an order of magnitude more ambitious. So, despite the big, juicy turkey leg labeled “4.3” in the thought bubble over my head, I’m on workaday bug fix duty. But don’t worry, I’m also getting cerebral about it.
I’ve been thinking about bugs, so I’m thinking about how I think about bugs. Some are quick and easy to fix. Others are intractable labyrinths. My trusty internal monologue treats the existence of either as an opportunity to shit-talk myself to myself, but sometimes, between you and me, I’m not sure that’s totally justified. Sure, Albums is an extension of myself, and when people use it, I want it to be absolutely clear that it’s made by someone who cares. I’ve also placed a dollar value on the privilege of using it, and that implies a certain quality standard.
But you know what? Bugs are fucking everywhere. In everything. Have you ever used any Apple TV app? So rather than wither from embarrassment and disgust that something complex could ever have something wrong with it, cue up the “he admit it” guy, because it’s time to get specific on a couple bugs.
4.2.2, the version that introduced the custom cloud sync engine, had a pretty bad bug that only revealed itself once it was out of beta and in the real world. When you launched 4.2.2 for the first time, it checked to see if there was any content in the Albums container on iCloud. If so, it went into “restore from Cloud” mode, rather than “initial setup” mode.
It turned out, though, that a small percentage of people had an empty folder called “Documents” in that container, even though they hadn’t synced with iCloud before. For some new installs, this meant that the app never progressed past a “downloading with iCloud” screen. For some existing users updating to the new version, it meant that if they chose to sync with iCloud during the upgrade, all their music would be gone and the app would be empty (though recoverable!). Not great.
In 4.2.3, I changed the process to check iCloud for the existence of the specific library backup file, rather than the existence of anything at all in the container. Does that make the original a terrible solution? Maybe not the best, most specific solution, but it wouldn’t have been possible for this situation to arise during beta testing. At the time 4.2.2 went live, I had no reason not to believe that the only way for anything to be in iCloud was if a user had already done an iCloud sync. As far as I knew, my solution worked.
Worst of all, some bugs are only solvable when the universe is ready for you to solve them. Albums Twitter OGs will no doubt get all warm and fuzzy at the mention of the Incredibly Stupid Playback Hack, a workaround I had to implement after iOS 13.4 made changes to the Media Player framework that made it so my method of resuming playback where you left off between app sessions was unreliable. The ISPH — basically just a timer that checked to make sure a song’s playback wasn’t earlier than it was supposed to be — worked almost all the time for library items. I needed to make it even more incredibly stupid after adding support for non-library Apple Music items in 4.0, but it had mostly been working on those too.
Apple Music playback has always been a little wonkier than I’d like, and there’s been a crash I’ve been trying to track down for months now. After a user reported it again this week, I vowed to finally fix it this time, and in desperation I went back again to the Media Player documentation. I have read every word on those pages several times over the years, but this time, as I read the page for the catchily titled MPMusicPlayerPlayParametersQueueDescriptor, the clouds parted and a golden light shone down.
Not only does using it solve the crash. And not only does using it fix all of the Apple Music wonkiness. But it makes the Incredibly Stupid Playback Hack, finally, blissfully, utterly obsolete. It took ten minutes of work to implement it, a year and a half after I could have. I guess I have to chalk that one up to a cosmic joke. That’ll be included in 4.2.4, which should be out by sometime next week.
See you in two weeks.
Hi Adam we all know about bugs🙏🏻 Here is a new one. CarPlay deleting som to add new ones. That can’t do anymore. Right now my list is 3 out of 6 possible 😢