[Webkit-unassigned] [Bug 183167] Cannot store CryptoKey to IndexedDB in ServiceWorker

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Aug 22 15:04:45 PDT 2018


Joseph Liccini <joliccin at microsoft.com> changed:

           What    |Removed                     |Added
                 CC|                            |joliccin at microsoft.com

--- Comment #6 from Joseph Liccini <joliccin at microsoft.com> ---
I also am running into this issue.

It is not specific to IndexedDB as noted.

It occurs with postMessage as well, so it is indeed related to the structured clone algorithm from within the Service Worker Global Scope context.

I am able to use the structured clone algorithm for CryptoKeys within the Window context, but not within the ServiceWorkerGlobalScope context.

You can get the same exception by trying to `postMessage` to a `Client` object from the service worker the `CryptoKey`.  And you will get the same 'DataClone' error.

But a `postMessage` on the `window` object via `window.navigator.serviceWorker.controller.postMessage` will not throw the exception.  In this case the structured clone succeeds.

I can prepare a Plunkr soon.

I am hypothesizing that a workaround would be for the service worker to only perform `read` operations into IndexedDB for the CryptoKey, and all write operations will have to happen on the Main thread.

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/20180822/1a590e26/attachment.html>

More information about the webkit-unassigned mailing list