BUG: Weird misbehavior on Safari using middleware & blob
When using a middleware that modifies a record containing a blob the code crashes on latest Safari (17.4 [19618.1.15.11.12]) with an error:
UnknownError: Error preparing Blob/File data to be stored in object store UnknownError: Error preparing Blob/File data to be stored in object store
This only happens in some scenarios. E.g. it depends on the total number of records in the table and the blob type! Is this a known bug? Any idea for this?
Here you can see a minimal repro: Stackblitz
- Hit "Prepare"
- Wait a few seconds
- Hit Crash (maybe a few times)
Sometimes you have to restart the browser, wait a moment, hit Crash several times ... it's pretty random
Sorry for bumping but this bug really is super important for me right now. Any chance to get a soon response?
It seems this hasn't to do with middleware. I modified the repro to insert the flags in the put operations and could make it crash also then: https://stackblitz.com/edit/stackblitz-starters-huwmol?file=src%2Fmain.ts
I think we will be able to workaround this issue the same way we do for other uknownerror problems we workaround. We should probably be catching the UnknownError and retry the operation under the hood.
This will have to wait to after the Dexie Cloud launch on March 27 but I see it as an important as it is in line with how dexie generically works around issues like these.
Oh, I didn't notice! Tought I correctly broke it down to the middle ware. This minimal repro was a two day bug hunt ... Don't you even ask ... But thank you so much for investigating! Looking forward for the next version!
Guess that's not included in the latest 4.0.2, is it? Any estimations possible? But no hurries! :)
No it's not. I've set May 15 as end date on this issue in the project and prio 1. But it's still a guess.
Ah, just seen it! Thank you very much! :)
Sorry for bumping, but guess fix didn't make it to 4.0.8, yet?
Correct, it's not there yet.
Sorry to nag again but - news on this? Asking because I just hit another issue: Right now getting pretty ofter a dataloss error (https://forums.developer.apple.com/forums/thread/750122). Happens with new IPads it seams ...
Anything I can do right now? End the connection, wait a second and try again? Closing / opening the browser solves the issue right now.
Thanks for reminder
Small reminder, again? Sorry for bumping 😶🌫️
Just noting that I'm seeing the same in both desktop/mobile safari (latest versions), especially in private browsing.
In my case, nothing to do with middleware, but just object creates/updates when it contains a blob.
Looks like my experience is very similar to #1227
My solution at this time is to convert the blob/file to something resembling what emscripten does, where I store the name/mime type/binary data as a Uint8Array.