Skip to content

Promise resolution in "determine the storage access policy" seems wrong? #152

@domfarolino

Description

@domfarolino

Pre-requisite context: #151.

First point

Assuming my analysis of #151 is correct, then I think we should be passing |p| from https://privacycg.github.io/storage-access/#dom-document-hasstorageaccess into the https://privacycg.github.io/storage-access/#determine-the-storage-access-policy algorithm. That promise resolves to a boolean, but inside https://privacycg.github.io/storage-access/#determine-the-storage-access-policy it only ever gets "resolved", not resolved with a particular value. Rejections seem to be handled correctly from a syntactic point of view.

Second point

But semantically but I was surprised to see that:

If implicitly denied is true, queue a global task on the permission task source given global to reject p with a "NotAllowedError" DOMException, and return p.

I don't know much about the storage access spec, but as per https://w3ctag.github.io/promises-guide/#rejections-should-be-exceptional it seems that maybe if implicitly denied is true, we should just be resolving the promise with the "false" value, since rejections are supposed to be reserved for real exceptional errors, and not just a true/false answer? Again I'm not super familiar with this spec in general so I could be off the mark, but let me know what you think.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions