This article is more than 1 year old

That thing you were utterly sure would never happen? Yeah, well, guess what …

Never. Test. In. Production.

Who, Me? A Who, Me? moment last week introduced a much-needed laugh into the lives of at least a few end users, after a bit of testing in production had all too familiar consequences.

Cuvva is an app-based car insurance service. It is a handy thing for some — rather than signing up for an annual policy, a customer can use its app to set up insurance that lasts for just an hour or so. It can also push out app notifications, one of which made a programmer's little joke all too public.

"What could possibly go wrong?" asked the programmer (and Cuvva's lead Android engineer) Adam Bennett. Within minutes, he had his answer: rather a lot.

Bennett had inadvertently pushed a notification out to thousands of the company's Android app users.

In a "cautionary tale" posted over the weekend, Bennett gave a refreshingly open explanation of how he had "accidentally pinged every Android customer in production."

The problem, it appeared, came from a desire to bring the Android app up to parity with the iOS version in terms of push notifications.

"I set out to work out the exact state of push notifications on the Cuvva Android app," he explained. He picked through the code to check for references to the messaging platform of choice, Firebase Cloud Messaging (FCM), checked the dependency tree for any hidden usage and took a close look at the FCM console itself. The latter showed iOS (and web) as configured, but nothing for Android.

"At this point I was 100 per cent convinced that there was no way that our Android app could pick up a notification," he wrote.

So, he did the FCM integration, prepared his test message and, sure that nobody would ever actually see the notification, sent out what, in retrospect, turned out to be a tweet of unalloyed hubris. He then pressed the button.

To be fair, FCM had warned him that over half a million devices would be affected ("in hindsight — this number didn't match our analytics, so where did it come from? That's right: registered push tokens") which gave Bennett a little pause for thought. Sadly, however, not enough.

Despite his absolute certainty that the message would never be seen, approximately 120,000 push notifications were received and around 20,000 were opened. Oops.

"It was an odd feeling," Bennett told The Register, "a mix of immediate dread giving way to humour at the absurdity of what I'd done." As the screenshots poured in from amused customers "my horror quickly turned to embarrassment and amusement."

But what had happened? The answer was that while the code Bennett looked at was sparklingly clean, the team had recently removed a library which included the default FCM service. It had been evaluated and eventually dropped three weeks prior. However, the version of Cuvva's app in use by the majority of users still had it and push tokens had been quietly registered. Therefore, that majority of users received a dose of Bennett's humour.

Fortunately for the Android engineer, the impact was ... pretty good. Customers saw the funny side and Cuvva's social media team revelled in "the most social media engagement we've ever had."

Indeed, Bennett's employer was very understanding. "We have an internal Slack channel," Bennett told us, "encouraging the team to share mistakes," and he highlighted a corporate culture that encouraged the discussing of cockups rather than sweeping the smoking remains under the nearest carpet. "If you make a mistake as public as this," he said, "it's better to lean into it rather than cover it up and attempt to shift blame."

It could have been so much worse had Bennett dropped a swear or two into his "test" (this hack well remembers some test data sneaking into a customer demo many years ago that left a sales exec speechless and at least one programmer jobless) and he had some advice on top of the obvious Do Not Test In Production.

"Do not write something you wouldn't want customers to see," he said. Dropping something like the f-bomb or dishing the dirt on company politics could be severely career limiting. He went on to point out that "your app is not necessarily the customer's app" and dispensed useful advice concerning notifications and the vetting of libraries.

We'll give Bennett the last word:

"And finally: Do. Not. Test. Notifications. In. Production."

Ever watched in horror as your own in-joke was unexpected unleashed upon the innocent, or been on the receiving end of a programmer's wit? Let us know with an email to Who, Me? ®

More about

More about

More about

TIP US OFF

Send us news


Other stories you might like