[Webkit-unassigned] [Bug 240216] New: Safari corrupts already-rendered blobs after saving to IndexedDB

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sun May 8 09:38:33 PDT 2022


https://bugs.webkit.org/show_bug.cgi?id=240216

            Bug ID: 240216
           Summary: Safari corrupts already-rendered blobs after saving to
                    IndexedDB
           Product: WebKit
           Version: Safari 15
          Hardware: Mac (Intel)
                OS: macOS 12
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: New Bugs
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: micah.millereshleman at gmail.com

Created attachment 459014

  --> https://bugs.webkit.org/attachment.cgi?id=459014&action=review

Exported codepen (use dist folder)

At befunky.com, we save image Blobs in IndexedDB so we can recover a user's photo editing progress if WebGL crashes. This often fails for returning users in Safari, and we finally figured out why.

Here are the exact steps to take to reproduce:

1. Save an image Blob in IndexedDB
2. Reload the page
3. Grab that image Blob and render it to a canvas (e.g. via  + ObjectURL)
4. Save the image Blob in IndexedDB again.

(sometimes) Repeat steps 2-4
You'll eventually reach a state where the image blob from IndexedDB cannot be read by FileReader, even though it has correct properties otherwise (e.g. size). To consistently replicate, it's important that:

- The page is refreshed between saving & getting blob
- The blob is rendered to Canvas before saving
- The blob is saved over itself (same IndexedDB key)

This is a bit tricky to replicate, so I created a reduced-test-case in a Codepen.
https://codepen.io/pranksinatra/pen/MWjRZOq?editors=1010

Alternative, you can download the attached zip file (use dist) folder to replicate on your local machine, or download it here:
https://codepen-api-export-production.s3.us-west-2.amazonaws.com/zip/PEN/MWjRZOq/1611347502267/safari-indexeddb-blob-bug.zip

Really appreciate the Safari/Webkit team looking into this. We've tried for years to pin down this issue and it causes a lot of user pain!

The original WebCompat report is here: https://github.com/webcompat/web-bugs/issues/66063#issuecomment-765870592

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20220508/d8e994e5/attachment.htm>


More information about the webkit-unassigned mailing list