WICG / digital-credentials

Digital Credentials, like driver's licenses
https://wicg.github.io/digital-credentials/
Other
82 stars 9 forks source link

Handling ongoing operations / subsequent call to get() #159

Open marcoscaceres opened 3 months ago

marcoscaceres commented 3 months ago

The spec is currently missing a model for dealing with subsequent call to get() (i.e., subsequently calling .get()).

We have two options. A subsequent call to get():

  1. aborts the current get request (AbortError). New call to get() takes over.
  2. gets aborted or invalidated (with the respective exceptions). Current call continues until it settles.

Given that we always show UI, the implications of 1 could be annoying to users. It would mean it would that it could be used to serve the same purpose as the abort controller.

Thus, my preference is that we use 2, as it prevents accidental tear down of the presentment UI. Developers can still tear down the UI with the abort controller whenever they choose.

Thoughts?

samuelgoto commented 3 months ago

Thoughts?

Option (2) SGTM, that's what we do for FedCM too: we consider it a developer error, because they could have used the AbortController to cancel the first request if they wanted to.

https://github.com/w3c-fedid/FedCM/issues/340