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

PresentationRequest.getAvailability() could always return a new Promise #507

Open
markafoltz opened this issue Sep 30, 2022 · 1 comment · May be fixed by #525
Open

PresentationRequest.getAvailability() could always return a new Promise #507

markafoltz opened this issue Sep 30, 2022 · 1 comment · May be fixed by #525
Assignees
Labels

Comments

@markafoltz
Copy link
Contributor

The steps for getAvailability() have an optimization (?) to return (sometimes) a pre-existing Promise from a previous call to getAvailability().

However this isn't consistent with other specs that always return a new Promise when starting an asynchronous action on another device:

Those are a few examples pulled by skimming other specs, there are likely more.

The Promise-caching also produces some implementation complexity because the browser must sometimes store the Promise like a property of the request, and sometimes allocate a new object and pass it directly to script.

It would be simpler to implement, and more consistent with other specs, to always return a new Promise here.

@markafoltz
Copy link
Contributor Author

This Blink code review has some additional conversation about why this is simpler to implement (at least in Blink.) The CL was abandoned until the spec could be updated with this behavior.

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

Successfully merging a pull request may close this issue.

1 participant