Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue #151 - Make it possible to reject a promise from getHighEntropyValues #163

Merged
merged 1 commit into from
Jan 8, 2021

Conversation

miketaylr
Copy link
Collaborator

@miketaylr miketaylr commented Dec 16, 2020

This partially addresses #151 by allowing UAs to reject the promise created from getHighEntropyValues. Once we have consensus on the rest, we can remove the issue and clarify what it means to "decide".

PTAL @amtunlimited

cc @othermaciej


Preview | Diff

@miketaylr
Copy link
Collaborator Author

gentle ping @amtunlimited ❤️ 🌈 🐰

@amtunlimited
Copy link
Contributor

Sorry about the delay. Been a crazy...time?

Quick question: If I'm reading this correctly, does this mean that if one hint is rejected, the client does not get any hints?

@miketaylr
Copy link
Collaborator Author

Quick question: If I'm reading this correctly, does this mean that if one hint is rejected, the client does not get any hints?

Correct. You don't get any hints from getHighEntropyValues if the UA decides you can't have one. Right now there's no platform-notion of "partially resolve a promise", and it seems better to know up front that you didn't get some of the data you wanted then have to double check every item you did get back for a non-null result.

Perhaps a non-normative Note would be useful to encourage UAs to give some more context as to why they just sent a NotAllowedError?

@amtunlimited
Copy link
Contributor

Perhaps a non-normative Note would be useful to encourage UAs to give some more context as to why they just sent a NotAllowedError?

IIRC we explicitly didn't do this for the headers (e.g. setting some sort of "not set" header). If I can find the relevant discussion I will link it here.

Is there a notion of "optional" in JS to represent not-present vs intentionally blank?

@miketaylr
Copy link
Collaborator Author

Is there a notion of "optional" in JS to represent not-present vs intentionally blank?

Yeah, that's what null represents (vs undefined). I thought about returning null for values that the UA wants to refuse, but I think getting a rejected promise for the whole lot is conceptually simpler.

Copy link
Contributor

@amtunlimited amtunlimited left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants