-
Notifications
You must be signed in to change notification settings - Fork 135
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
Need to define the interaction of payment API with navigation and browsing context destruction #360
Comments
The answer should be "abort all algorithms," IMHO. Does that sound OK? Specs usually don't speak about UI. So Chrome might chose to show a message "transaction cancelled due to navigation" in UI, but that should not be in the spec, so Firefox, for example, can do something different, if they want. Whether the payment has been processed depends on when navigation or browser context destruction happened:
|
What does that mean in practice? Do the returned promises get rejected? Remain pending forever? If they get rejected, do they trigger their callbacks? I expect this to be a significant source of non-interop especially if the payment request is triggered from an iframe that is then navigated or removed from the DOM, because browsers tend to disagree on what exactly gets torn down in those situations. :(
Sure. This issue is about the web-observable behavior.
Right, this is all racy. |
OK, most of the easy stuff has been fixed or PRed; now time to tackle this one. First, what are the concrete, web-observable cases we're concerned with here, where one of the things Boris listed could happen? My enumeration is as follows, but please check it:
Does this cover it? If so, I think what we need then is:
I've been using "things happen" to mean all the things @bzbarsky lists in his original post. @bzbarsky, do you think this captures that, in precise spec terms? Things have happened if "the PaymentRequest's relevant global object's Document is no longer fully active." |
@bzbarsky ping... |
I think there is one more case:
As far as defining "things happen"... the problem is that it's not clear to me that the "fully active" concept captures everything. In particular, it's not clear to me whether removing an iframe from the document means the last document that was in it is no longer "fully active", and similar for the tab closing case... |
@domenic do you think you have everything that you need here to make a decision on how to move forward? |
Yes, I do. Sorry, I just have been swamped with other things :-/ |
It turns out much of this is unnecessary as per the event loop spec tasks on non-fully active documents are not executed. So now that we are properly queuing tasks to do observable things, (B) and (C) from #360 (comment) are not a concern. (A) is still a potential concern though, so I will fix it. Also, in that comment I said we'd just leave the promise pending, but now I think just rejecting with an "AbortError" DOMException makes more sense. |
Closes #360. Overriding IPR block
I don't see anything in the spec that describes what happens if any of the following happen while a payment request is in progress:
Part of the issue here, of course, is that there is a bit of a lack of spec clarity around what happens to event listeners and Promises when these things happen. But even apart from that, it's not clear what should happen to the UA-provided payments UI when these things happen. It's also not clear what happens if these things happen between the user dismissing the browser-provided UI (e.g. accepting the payment) and the "user accepts the payment request algorithm" running.
The text was updated successfully, but these errors were encountered: