31 ms·
IndexedDB is completely broken in latest Safari
- astlouis44 5y agoHey feross, serious question for you - do you think this exists on purpose in order to hamstring WebGL apps that pose a threat to Apple's lucrative walled garden..?
- feross 5y agoI've posted my thoughts about Safari before here: https://news.ycombinator.com/item?id=27455107 https://news.ycombinator.com/item?id=27455107
- astlouis44 5y agoI agree with your take. Also, huge fan of Wormhole and overall dig what you’re working on to push the limits of web browsers. Another dev and I are creating a few 3D web projects, one of which is a decentralized web gaming platform for Unreal Engine 4 indie developers to ship their projects directly to their audience without needing to go through walled gardens like the App Store. Will DM you on Twitter as well!
- dmitriid 5y ago> Missing many APIs that would actually let websites truly compete with native apps. Just a few that we use: > * File System Access API (https://web.dev/file-system-access https://web.dev/file-system-access) You realise, right, that Firefox is also not keen on implementing this api? [1] And many others [2] [1] https://www.chromestatus.com/feature/6284708426022912 https://www.chromestatus.com/feature/6284708426022912 [2] https://webapicontroversy.com https://webapicontroversy.com
- throw_m239339 5y ago> You realise, right, that Firefox is also not keen on implementing this api? [1] And many others [2] Yeah, Mozilla used to be the beacon of Web standards, what happened to them? They always find some silly justification to refuse implementing a spec, like WebSQL, half of the Web Component spec, and many many other things, what gives? Chrome might be "bad" cause Monopoly, but Google is much much more pro-active in implementing useful standard proposals.
- dmitriid 5y ago> Mozilla used to be the beacon of Web standards, what happened to them They still are. Only now Google inundates everyone with Google-designed Chrome-internal "standards", and releases them against any objections. See WebHID as the best example of this: Issue https://github.com/mozilla/standards-positions/issues/459#issuecomment-753864467 https://github.com/mozilla/standards-positions/issues/459#is... and timeline https://news.ycombinator.com/item?id=27512354 https://news.ycombinator.com/item?id=27512354
- cyanydeez 5y agomaybe we need a good monopoly lawsuot since safari is usually the only browser available on the iphone. im tempted to just x out the safari logo on mine since it likely cant be tested
- greatemulsifier 5y agoI’m fairly certain there are other browsers on iOS. Like Firefox and chrome.
- riffraff 5y agoBut they use the same engine, they're basically skins for Safari.
- SilverRed 5y agoWhich means they all have exactly the same IndexedDB bugs and no one but apple can do anything about it.
- acrooks 5y agoThere are other browsers but they’re all forced to use the Apple browser engine, so Chrome on iOS is WebKit-based, for example.
- astlouis44 5y agoAgreed. Apple are dragging their heels and will fight tooth and nail to protect their precious Apple Store revenue powered by the almighty 30% cut.
- tasogare 5y agoWhich is kinda unnecessary: PWA are so bad that a good strategy would be to allow them (for instance by allowing Chrome with its own rendering engine), then let users decide what they prefer.
- floatingatoll 5y agoApple responded: > I have identified the regression point and assigned the bug to somebody. Thank you for the bug report. We will try and get this fixed ASAP.
- wereHamster 5y agoIn other words: we may fix this next year. Or the year thereafter. No promises though.
- michelb 5y agoWell most Radars don't get assigned, so this is promising.
- floatingatoll 5y agoMost radars don’t get a public tweet saying ASAP, either!
- saagarjha 5y agoAll Radars get assigned, they just may not be assigned with a reasonable priority to an engineer who will work on it.
- hu3 5y ago> Opening an IndexedDB database fails 100% of the time on the first try. This is something that should have been caught by automated tests.
- andrewmcwatters 5y agoOh man, if you think browsers are well tested automatically, you’re very far off reality. There’s basically no automated test suite even for CSS 2.1 that all vendors can rely on that matches behavior specified by the standards. Luckily standards like that are so mature that it’s not needed as badly, but it definitely keeps incumbents safe from competition.
- hu3 5y agoAre you speaking from experience? Because a cursory glance at Chromium src tells me they do have automated tests for IndexedDB: https://source.chromium.org/chromium/chromium/src/+/main:content/browser/indexed_db/indexed_db_tombstone_sweeper_unittest.cc?q=indexdb&ss=chromium https://source.chromium.org/chromium/chromium/src/+/main:con...
- andrewmcwatters 5y agoYes, I am. I'm an implementor. Some of the most fundamental parts of the web don't have comprehensive test suites. IndexedDB is relatively much more modern. However, if you do stumble on some tests for basic things like the box model, I'd love to know where they are! Tests like those would allow other vendors to know whether or not they're adhering to specification, programmatically. Earlier standards are very descriptive, rather than telling you how to implement the actual web technologies. That's left as an exercise for the reader. Seriously!
- hu3 5y agoInteresting. This makes it even more bafling to me that Safari doesn't have basic unit tests for a modern feature such as IndexedDb. It's certainly not for a lack of funds. I guess applications living in the browser don't align well with Apple's interest in pushing their app store.
- BiteCode_dev 5y agoWhen something like this happens, you realize that it's not ust your client or your company that sucks at testing software.
- boredprograming 5y agoEhhhhh I'll give them a pass on this. Almost nobody is using it because browser support was never that great and it's being deprecated. We should focus on reducing browser feature creep. There's hundreds of features and most of them are barely used or legacy
- feross 5y agoUhh, IndexedDB is not deprecated and every browser supports it: https://caniuse.com/?search=indexeddb https://caniuse.com/?search=indexeddb
- SilverRed 5y agoI wonder if it ever made sense for the browser to provide this facility over exposing a sandbox where the app can store arbitrary data and provide its own version of sqlite for js/wasm. At least this way your own bundled db won't be broken by browser bugs.
- int_19h 5y agoBy the same logic, did it ever make sense for the browser to provide JS, instead of wasm + well-defined DOM API? And I think the answer is that, no, it did not. And I suspect that we'll end up in a wasm-first world eventually anyway, just with a lengthy and inconvenient detour. But it's worth remembering that IndexedDB predates wasm by several years.
- throw_m239339 5y agoYou need a way to make sure whatever WASM database you bundle with your front-end app actually persists data somewhere in a transactional way. You cannot do that if you do not have a transactional data store as a WebAPI at first place. Local storage isn't.
- mnahkies 5y agoI think you're thinking of websql https://dev.w3.org/html5/webdatabase/ https://dev.w3.org/html5/webdatabase/
- brigandish 5y agoIt's a terrible API anyway and if it died I wouldn't shed a tear. If you need a good laugh (or more likely, a heart attack from the blood pressure rise it will induce) have a look at this blog post[1] by Mozilla justifying not using SQLite and choosing to implement the much more "elegant" IndexedDB. That post has too many examples of hubris and delusion for me to bother quoting it here, I'd just be reproducing most of it. Then you can go to their code comparison page[2] and wonder what the hell they were on about. > IndexedDB generally simplifies the programming model for interacting with databases, and allows for a wide number of use cases. They can't be looking at the same code - what have they improved other than to use more Javascript? The sooner it dies the sooner an alternative can appear… SQLite3, anyone? [1] https://hacks.mozilla.org/2010/06/beyond-html5-database-apis-and-the-road-to-indexeddb/ https://hacks.mozilla.org/2010/06/beyond-html5-database-apis... [2] https://hacks.mozilla.org/2010/06/comparing-indexeddb-and-webdatabase/ https://hacks.mozilla.org/2010/06/comparing-indexeddb-and-we...
- feross 5y agoIndexedDB does indeed suck, but there's really no alternative to it if you want Safari and Firefox support. Fortunately, in Chrome we have the FileSystem Access API which has a feature that lets you write into an "origin private" store, similar to how IndexedDB partitions storage per origin. There's even recent work to add even higher performance APIs into the Filesystem Access API and the reception from Firefox and Safari has been positive. Really early work is happening here: https://github.com/WICG/storage-foundation-api-explainer https://github.com/WICG/storage-foundation-api-explainer and the latest proposal is here: https://docs.google.com/document/d/121OZpRk7bKSF7qU3kQLqAEUVSNxqREnE98malHYwWec/edit https://docs.google.com/document/d/121OZpRk7bKSF7qU3kQLqAEUV...
- dmitriid 5y ago> There's even recent work to add even higher performance APIs into the Filesystem Access API and the reception from Firefox and Safari has been positive. Positive as in: "FileSystem Access is a significant security risk and we're not going to implement this"? https://www.chromestatus.com/feature/6284708426022912 https://www.chromestatus.com/feature/6284708426022912 Positive as in "No, we don't want fifteen different file access apis, and we don't think Storage Foundation API is going anywhere"? https://www.chromestatus.com/feature/5670244905385984 https://www.chromestatus.com/feature/5670244905385984 And even though this is a draft created and authored exclusively by Googlers, even other Googlers are confused: https://github.com/WICG/storage-foundation-api-explainer/issues/8 https://github.com/WICG/storage-foundation-api-explainer/iss...
- feross 5y agoOP here. This issue broke the website we've been building: https://wormhole.app https://wormhole.app The vast majority of the time we spend diagnosing and working around browser bugs is devoted to Safari. As an iPhone/Mac user and lover of all things Web, I really, really want Apple to get their act together with Safari. We sadly keep running into issues like this. Here are a few more recent examples: https://twitter.com/feross/status/1386835131780931587 https://twitter.com/feross/status/1386835131780931587 https://twitter.com/feross/status/1392671684419735552 https://twitter.com/feross/status/1392671684419735552 https://twitter.com/feross/status/1263544033135038464 https://twitter.com/feross/status/1263544033135038464
- the_gipsy 5y agoStockholm syndrome
- deleted 5y ago[deleted]
- ksec 5y agoThere isn't a single Window PC system on the market which I would rate at 80% of current MacBook M1 / iMac has to offer. It is not that people aren't looking for alternative. It is simply Windows PC industry has a lot of catching up to do. Both software and hardware. And its annoying because Apple desperately need some competition. Edit: And their strategic direction / decisions without Steve Jobs are all over the place. Along with their hypercritical PR since 2015.
- deleted 5y ago[deleted]
- uzakov 5y agoDell XPS 15 or Dell XPS 17 - quality build, good specs, has a dedicated GPU, decent price(at least in the USA) good size. Whenever I hear "Windows PC industry has a lot of catching up to do" I always ask what particulars are you missing or not there?
- tehbeard 5y agoGetting real tired of having to deal with apple as a problem child on the web.
- Tepix 5y ago"Completely broken" yet "we added a workaround [...] – so Safari users should be good to go" That seems rather contradictory
- magicalhippo 5y agoWhy? At work we've had several cases where one API (or similar) turned out to be completely broken, yet we successfully implemented a workaround using another API. That doesn't change the fact that the API we initially tried to use was completely broken. Like, maybe the service we needed to supply with data had a REST API which turned out to be completely broken, so we ended up reverting to generating XML files and uploading that via SFTP. That the data ended up where it needed to doesn't change the fact that their REST API was broken.
- Tepix 5y agoIn this case it seems like a retry will change this API from "completely broken" to "working again".
- magicalhippo 5y agoHow so? I didn't mean broken as in the web server didn't respond or service wasn't running. I meant the API was broken, as in did not do the right thing.
- Tepix 5y agoTo ke "completely broken" means "broken beyond repair"
- magicalhippo 5y agoThat's not a definition I would agree with. Completely broken to me, in the context of API's at least, means it doesn't do at all what it is supposed, or documented, to do. A file server which claims to store files for late retrieval but saves all incoming files to /dev/null is completely broken from the user POV, while it's likely not beyond repair.
- etaioinshrdlu 5y agoYes... I've felt for years now that Safari in particular prioritized UI speed over correctness. They don't seem to care what they have to do to get a buttery UI. It is indeed buttery, much more than any other browser, but at what cost? Bugs.
- loevborg 5y agoI'm keeping a record of all the problems around IndexedDB at https://gist.github.com/pesterhazy/4de96193af89a6dd5ce682ce2adff49a#bugs-bugs-bugs-safari https://gist.github.com/pesterhazy/4de96193af89a6dd5ce682ce2... I just added a section on Safari's storage related bugs, of which there are many. Amazingly, IndexedDB broke in Safari 14.1.1 after localStorage broke in Safari 14.1, released a month earlier.
- tb100 5y agoI wrote up the bug report for this a couple of weeks ago when iOS 14.6 first rolled out. iOS 14.6 at least did finally fix using HLS streams in gl.texUpload2D() on iPhone 12 series (which was broken since launch) but this new bug did mean our delight at that fact was somewhat short-lived! Well done on your viral tweet that got some personal attention from Apple. Usually when I spend days narrowing down Safari bugs to minimal reproducible test cases, finding workarounds, and writing everything up in detail on the webkit bug tracker the only public response from Apple is the radar importer bot, and then everything goes quiet. Btw, your original twitter thread implies you were the author of the bug report. Minor annoyance, but I did spend quite a while writing that up :)
- tb100 5y agoChrome 91 on Android also managed to break WebAssembly memory growth which affects our sites too, so it's been a rough couple of weeks working around browser bugs for us. https://bugs.chromium.org/p/v8/issues/detail?id=11863 https://bugs.chromium.org/p/v8/issues/detail?id=11863 I find the Chromium team much more willing to engage directly and constructively on their bug trackers at least.
- thedreamwork 5y agoI also encountered this problem, can you please tell me how you solved it on Chrome 91 version?
- feross 5y agoI’ve been shocked at the number of show-stopper bugs shipping in Safari recently so I’m doing what I can to draw attention to it. I hope it helps the Safari team get the resources they need from the big wigs at Apple. Also: Didn’t mean to imply I wrote that report. We were about to open a duplicate issue before noticing yours. Thanks!
- tb100 5y agoNo worries, I imagine many teams have been through the same process over the past couple of weeks! We've definitely had the same experience of Safari introducing way more issues with new releases than Chrome, and the fact it's part of the iOS image seems to make quick patching just never really an option. I just wish they'd engage a bit more directly on the bug tracker - find it hard to believe that twitter is a more effective means to get attention on bugs.
- Jyaif 5y agoHow much money is Apple earning via native apps? How much money is Apple earning via the web? By answering those two questions you can get an idea of where they are putting their ressources.
- trzeci 5y agoIt was never working in the context of iframe (Games on Facebook)
- pornel 5y agoAnd AppStore rules forbid everyone from distributing/obtaining a browser that doesn't have such problem (and this isn't even one-off for Safari. Anyone who writes web apps can tell you they keep having such bugs). Apple made it easy for themselves to have zero competition in browser engines.
- tyingq 5y agoI'm surprised Apple wouldn't have some sort of regression test against a large sample of real websites.
- roody15 5y agoI am convinced apple messes with indexedDB as just a way to promote its App Store. Any long term storage or web tech that makes an website behave too “app” Apple seems to make it a pain to support.
- The_rationalist 5y agoSafari is mostly abandonware at this point.