privacycg / storage-access

The Storage Access API
https://privacycg.github.io/storage-access/
199 stars 26 forks source link

hasStorageAccess() deals with promises in parallel #151

Closed domfarolino closed 1 year ago

domfarolino commented 1 year ago

While in parallel, the hasStorageAccess() algorithm creates a promise and fulfills it in-parallel, which is an invalid usage of the Promise API.

More generally, I don't really understand the flow of that algorithm. The method itself returns a promise and then right when it goes in parallel it creates another promise which becomes the resolved value of the outer promise? It seems like we should just pass in the first promise (that was properly created on the main thread) into the https://privacycg.github.io/storage-access/#determine-the-storage-access-policy algorithm, which would then resolve/reject it accordingly.

cfredric commented 1 year ago

Worth noting that both of those issues will be fixed in my PR (#141).

annevk commented 1 year ago

This has indeed been resolved, although we might move back to using in parallel in #174 (but without this issue).