Bug 188438

Summary: Storing blobs in IDB on iOS: "Error preparing blob/file"
Product: WebKit Reporter: Jake Archibald <jaffathecake>
Component: New BugsAssignee: Sihui Liu <sihui_liu>
Status: RESOLVED FIXED    
Severity: Normal CC: achristensen, alecflett, beidson, bfulgham, cdumez, commit-queue, daniel, dillon, ews-watchlist, ggaren, hello, hi, jsbell, oneillua, sihui_liu, tom, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: Safari 11   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch
none
Patch none

Description Jake Archibald 2018-08-09 07:42:30 PDT
I'm seeing reports of this error on iOS 11.4.1:

https://github.com/jakearchibald/idb/issues/58
https://github.com/localForage/localForage/issues/834

It doesn't seem to happen on all devices, but I've seen it on a colleague's device.

Test: https://static-misc.glitch.me/idb-blob-test - you should see a picture of a cat.
Comment 1 Jake Archibald 2018-08-09 07:42:58 PDT
I haven't been able to recreate it on an iOS simulator.
Comment 2 Radar WebKit Bug Importer 2018-08-09 09:26:18 PDT
<rdar://problem/43097279>
Comment 3 Sihui Liu 2018-11-13 20:25:19 PST
Created attachment 354759 [details]
Patch
Comment 4 Alex Christensen 2018-11-14 10:44:41 PST
Comment on attachment 354759 [details]
Patch

This should have a test so we don't regress it again.
Comment 5 Sihui Liu 2018-11-15 08:54:36 PST
Created attachment 354939 [details]
Patch
Comment 6 Chris Dumez 2018-11-15 09:20:05 PST
Comment on attachment 354939 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=354939&action=review

> Source/WebCore/ChangeLog:9
> +        Since network process always has access to temp folder now, we don't need to grant access to each temp file.

"Since network process always has access to temp folder now".
-> You mean that you are introducing this behavior in this patch right? This is not pre-existing behavior right? If so, the change log should be clearer about that. It seems we are granting wider sandbox access to the network process with your patch and it is important to point out.

> Source/WebCore/ChangeLog:11
> +        No behavior change. Make three existing tests pass on iOS device. 

Sounds like a behavior change to me no? Presumably there was some use-case that was broken / did not work before and now works?
Comment 7 Sihui Liu 2018-11-15 11:20:50 PST
(In reply to Chris Dumez from comment #6)
> Comment on attachment 354939 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=354939&action=review
> 
> > Source/WebCore/ChangeLog:9
> > +        Since network process always has access to temp folder now, we don't need to grant access to each temp file.
> 
> "Since network process always has access to temp folder now".
> -> You mean that you are introducing this behavior in this patch right? This
> is not pre-existing behavior right? If so, the change log should be clearer
> about that. It seems we are granting wider sandbox access to the network
> process with your patch and it is important to point out.
> 

This is specified in Source/WebKit/ChangeLog. Will add to this one also.

> > Source/WebCore/ChangeLog:11
> > +        No behavior change. Make three existing tests pass on iOS device. 
> 
> Sounds like a behavior change to me no? Presumably there was some use-case
> that was broken / did not work before and now works?

We expected network process had access to temp folder in our code, so I though this is an "old" behavior which doesn't work... Will remove the "No behavior change".
Comment 8 Sihui Liu 2018-11-15 11:33:16 PST
Created attachment 354959 [details]
Patch
Comment 9 WebKit Commit Bot 2018-11-16 08:58:44 PST
Comment on attachment 354959 [details]
Patch

Clearing flags on attachment: 354959

Committed r238283: <https://trac.webkit.org/changeset/238283>
Comment 10 WebKit Commit Bot 2018-11-16 08:58:46 PST
All reviewed patches have been landed.  Closing bug.
Comment 11 Daniel Westendorf 2021-02-09 15:33:20 PST
I'm seeing this issue again on iOS 14.5 (18E5140k). The error is not present in 14.5 (18E5140i) or iOS 14.4.

UnknownError: Error preparing Blob/File data to be stored in object store
Comment 12 Daniel Westendorf 2021-02-16 11:18:47 PST
Regression no longer present in 14.5 (18E5154f), sorry for the noise.
Comment 13 Neil Kinnish 2021-10-13 15:28:27 PDT
I'm still seeing this issue and can easily re-create by opening Safari in private browsing on 14.7.1