Conversation
|
Good start! What I had in mind was perhaps a bit simpler:
Then when creating the worker you can grab all the Blob parts straight from the SQLite DB and re-construct the content. SInce the sqlite module is sync there is no need to await anyhing. |
779101b to
b14f873
Compare
|
Sorry, I had to push force because I authored then committed with a wrong email. So I got the api almost working in every case. Actually, in the test, I've added the revoke of the url after creating the worker. However, if you execute it a lot, sometimes, it will be done a bit too soon; before being queried by the eval. I will fix that. I've used the I've made the new commits as fixup for their previous related commit, like this when the review is done, I can squash them automatically to keep a clean commit history, while being able to review them easily. |
|
Feel free to keep pushing changes, we can squash when merging. |
|
I have the feeling that going for an in-memory sqlite database may be overkill, so here I simply use a js I got a working implementation. Now, maybe some work on the style and structure are needed? I wanted to use the |
|
Rebase on master. |
src/js/polyfills/url.js
Outdated
| } | ||
| }); | ||
|
|
||
| // TODO: straggly, without the wrapped console.log, the runtime will abort |
There was a problem hiding this comment.
Well, that is very weird. Do you have a backtrace?
There was a problem hiding this comment.
The problem is different now, the function is spammed. I made a small video capture to show you:
objecturl_bug.webm
Therefore, with the current case, I have no backtrace to provide. And I have no clue what is that printed SyntaxError, since there is no problem at all when running it with the empty console.log('').
|
Thank you! I did a full review round and left some comments. |
It doesn't really work and causes runtime startup problems.
|
@EmixamPP I discovered the source of the problem! The I disabled it since it didn't actually work, and squashed and force-pushed! |
ObjectURL API doc: https://developer.mozilla.org/en-US/docs/Web/API/URL/createObjectURL_static
It is more complicated than expected to solve #479.
I wanted to use the JS
Blob.text()method to retrieve the content of the stored blob (as aJSValue) in a global blob store. But the function isasync, and I'm not sure theJS_Callmethod can resolve and wait such a function, since it raisestjs__promise_rejection_tracker: Assertion '(JS_IsException(event)) == (0)' failed..Anyway, here is a draft PR that shows what I've tried so far, maybe you will be able to help me. Or my solution is too bad (I have the feeling that it is maybe a bit too hacky?), and it will be easier for you to start from scratch when you will have time later (don't worry if this is the case).
While I'm waiting for your review, I'll keep trying to fix and improve the solution.