Bug 222436 - [Payment Request] log if `updateWith` is not called synchronously
Summary: [Payment Request] log if `updateWith` is not called synchronously
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Platform (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Devin Rousso
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-02-25 13:17 PST by Devin Rousso
Modified: 2021-02-26 09:55 PST (History)
5 users (show)

See Also:


Attachments
Patch (7.91 KB, patch)
2021-02-25 13:19 PST, Devin Rousso
aestes: review+
Details | Formatted Diff | Diff
Patch (7.91 KB, patch)
2021-02-25 13:57 PST, Devin Rousso
no flags Details | Formatted Diff | Diff
Patch (12.73 KB, patch)
2021-02-25 21:45 PST, Devin Rousso
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Devin Rousso 2021-02-25 13:17:15 PST
According to <https://www.w3.org/TR/payment-request/#updatewith-method>:
> To prevent the user interface from blocking (and to reflect changes made by the end user through the UI), developers need to immediately call `updateWith()`.
AFAICT the spec doesn't specify what the user agent should do in the case that the developer doesn't immediately call `updateWith()`, but I think there should at least be a console message to help developers understand that this is expected (without expecting them to have to read the spec).
Comment 1 Devin Rousso 2021-02-25 13:19:40 PST
Created attachment 421557 [details]
Patch
Comment 2 Andy Estes 2021-02-25 13:54:32 PST
Comment on attachment 421557 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=421557&action=review

> Source/WebCore/Modules/paymentrequest/PaymentRequest.cpp:710
> +    scriptExecutionContext()->addConsoleMessage(JSC::MessageSource::PaymentRequest, JSC::MessageLevel::Error, makeString("updateWith() must be called synchronously when handling \""_s, event->type(), "\"."_s));

As we discussed, I think we should change "must" to "should".
Comment 3 Devin Rousso 2021-02-25 13:57:20 PST
Created attachment 421562 [details]
Patch
Comment 4 Devin Rousso 2021-02-25 21:45:53 PST
Created attachment 421608 [details]
Patch
Comment 5 EWS 2021-02-26 09:54:42 PST
Committed r273562: <https://commits.webkit.org/r273562>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 421608 [details].
Comment 6 Radar WebKit Bug Importer 2021-02-26 09:55:13 PST
<rdar://problem/74794561>