Skip to content

Commit

Permalink
retry() interacting with abort the update (#723)
Browse files Browse the repository at this point in the history
  • Loading branch information
marcoscaceres committed Jun 26, 2018
1 parent f15ef69 commit b417638
Showing 1 changed file with 43 additions and 14 deletions.
57 changes: 43 additions & 14 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3239,10 +3239,10 @@ <h2>
</li>
<li>Return <var>retryPromise</var>.
<p class="note">
The <var>retryPromise</var> will later be resolved or rejected by
either the <a>user accepts the payment request algorithm</a> or
the <a>user aborts the payment request algorithm</a>, which are
triggered through interaction with the user interface.
The <var>retryPromise</var> will later be resolved by the <a>user
accepts the payment request algorithm</a>, or rejected by either
the <a>user aborts the payment request algorithm</a> or <a>abort
the update</a>.
</p>
</li>
</ol>
Expand Down Expand Up @@ -3546,7 +3546,8 @@ <h2>
</td>
<td data-link-for="PaymentResponse">
Is true if the request for payment has completed (i.e.,
<a>complete()</a> was called), or false otherwise.
<a>complete()</a> was called, or there was a fatal error that
made the response not longer usable), or false otherwise.
</td>
</tr>
<tr>
Expand Down Expand Up @@ -4218,10 +4219,15 @@ <h2>
<li>Let <var>response</var> be
<var>request</var>.<a>[[\response]]</a>.
</li>
<li>If <var>response</var> not null:
<li>If <var>response</var> is not null:
<ol>
<li>Set <var>response</var>.<a>[[\complete]]</a> to true.
</li>
<li>Assert: <var>response</var>.<a>[[\retryPromise]]</a> is not
null.
</li>
<li>Reject <var>response</var>.<a>[[\retryPromise]]</a> with
<var>error</var>
<var>error</var>.
</li>
</ol>
</li>
Expand Down Expand Up @@ -4546,7 +4552,22 @@ <h2>
<li>Set <var>request</var>.<a>[[\state]]</a> to
"<a>closed</a>".
</li>
<li>Reject the promise
<li>Let <var>response</var> be
<var>request</var>.<a>[[\response]]</a>.
</li>
<li>If <var>response</var> is not null, then:
<ol>
<li>Set <var>response</var>.<a>[[\complete]]</a> to true.
</li>
<li>Assert: <var>response</var>.<a>[[\retryPromise]]</a> is
not null.
</li>
<li>Reject <var>response</var>.<a>[[\retryPromise]]</a>
with <var>exception</var>.
</li>
</ol>
</li>
<li>Otherwise, reject
<var>request</var>.<a>[[\acceptPromise]]</a> with
<var>exception</var>.
</li>
Expand All @@ -4560,17 +4581,25 @@ <h2>
</section>
<div class="note">
<p>
<a data-lt="abort the update">Aborting the update</a> is performed
when there is a fatal error updating the payment request, such as
the supplied <var>detailsPromise</var> rejecting, or its
fulfillment value containing invalid data. This would potentially
leave the payment request in an inconsistent state since the
developer hasn't successfully handled the change event.
<a>Abort the update</a> runs when there is a fatal error updating
the payment request, such as the supplied <var>detailsPromise</var>
rejecting, or its fulfillment value containing invalid data. This
would potentially leave the payment request in an inconsistent
state since the developer hasn't successfully handled the change
event.
</p>
<p>
Consequently, the <a>PaymentRequest</a> moves to a "<a>closed</a>"
state. The error is signaled to the developer through the rejection
of the <a>[[\acceptPromise]]</a>, i.e., the promise returned by
<a data-lt="PaymentRequest.show">show()</a>.
</p>
<p data-link-for="PaymentResponse">
Similarly, <a>abort the update</a> occurring during <a>retry()</a>
causes the <a>[[\retryPromise]]</a> to reject, and the
corresponding <a>PaymentRequest</a>'s <a>[[\complete]]</a> internal
slot will be set to true (i.e., it can no longer be used).
</p>
</div>
</section>
</section>
Expand Down

0 comments on commit b417638

Please sign in to comment.