This article is more than 1 year old
Bad Apple Safari update breaks IndexedDB JavaScript API, upsets web apps
Developers fed up with iGiant neglecting non-native software
Apple's WebKit team has managed to break the popular IndexedDB JavaScript API in the latest version of Safari (14.1.1) on macOS 11.4 and iOS 14.6.
The bug, first reported on June 2, 2021, only manifests when applications first try to use IndexedDB NoSQL manager to store data. Reloading a web page or app implementing the API resolves the issue, according to several bug reports.
Nonetheless, the situation is less than ideal for web developers and for anyone using the desktop or mobile versions of Safari. While there are a variety of storage APIs available to web developers, IndexedDB is one of two (the other being the Cache Storage API) that's recommended; the other options have specific use cases, shortcomings, or aren't widely supported.
Feross Aboukhadijeh, an open-source developer who runs Socket, on Monday said that the bug prevented his firm's web-based file transfer app Wormhole from working when initially loaded until a workaround was implemented.
"Opening an IndexedDB database fails 100 per cent of the time on the first try," he said via Twitter. "If you refresh, it starts working."
"It's really really hard to build reliable websites on macOS and iOS with showstopper bugs like this," he added, pleading with Apple's WebKit team to prioritize a fix. "This should have been caught by basic unit testing."
The Safari's issues with IndexedDB come as web developers await the release of a fix for a bug affecting localStorage, a more limited browser storage API, in Safari 14.1 and later, and word that an IndexedDB crash bug reported in 2019 will get some attention.
Paulus Esterhazy, director of engineering at presentation biz Pitch, recently documented various problems with IndexedDB, many of which have to do with Safari, in a GitHub post.
"The Webkit team keeps shipping critical storage-related bugs into production, again and again," he wrote.
- Googler demolishes one of Apple's monopoly defenses – that web apps are just as good as native iOS software
- My life as a criminal cookie clearer: Register vulture writes Chrome extension, realizes it probably breaks US law
- Apple: Relax, we're not totally screwing web apps. But yes, third-party cookies are toast
- IndexedDB pulls away from less-loved web storage options
The browser engineering teams for Chromium, Edge, and Firefox, among others, regularly introduce bugs of their own – Apple does not have a monopoly on code errors.
But Apple's technology poses a particular challenge for web developers because the company requires all iOS browsers to be based on WebKit, the rendering engine used in Safari. Competing with WebKit simply isn't allowed on iOS.
Apple's platform rules are currently under scrutiny from lawmakers and antitrust officials around the globe and, in California, from US District Court Judge Yvonne Gonzalez Rogers, who is expected soon to render a decision in Epic Games' antitrust lawsuit against Apple.
Google software engineers like Alex Russell have long complained that Apple's leisurely browser development roadmap, limited API adoption, and platform rules ensure that web apps cannot compete with native iOS platform apps.
But others unaffiliated with a major Apple competitor share that sense of frustration.
"Given Safari’s privileged position on iOS, Apple has been disappointing in how slowly they adopt standards (if at all) and how incomplete the implementations are, like for media playback and WebRTC," said software developer Matt Mastracci in an email to The Register.
"At some point the developer experience on Safari was top-of-the-line but they are falling into the same trap as Microsoft did when they had a monopoly on the desktop browser."
In a recent post to Hacker News, Aboukhadijeh complained that Apple's actions make it appear that Cupertino is "outright hostile to the web" and eager to push developers to create native platform apps (which, unlike web apps, Apple can control through its App Store rules).
"Apple's neglect and underinvestment in the web platform definitely precludes websites or 'PWAs' from having the 'have the look, feel and functionality of a native app," he wrote. "Safari suffers from the twin effects of limitations that Apple has intentionally put in place and intentional under-staffing of the Safari team."
We asked Apple about the IndexedDB bug and whether its Safari team is understaffed compared to the competition. We would be stunned if it chose to reply. ®