Bug 188551 - Unhandled Promise Rejection logging in workers should not emit ErrorEvent to host Worker object
Summary: Unhandled Promise Rejection logging in workers should not emit ErrorEvent to ...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Yusuke Suzuki
URL:
Keywords: InRadar
Depends on: 188265
Blocks:
  Show dependency treegraph
 
Reported: 2018-08-14 06:05 PDT by Yusuke Suzuki
Modified: 2018-08-14 10:57 PDT (History)
13 users (show)

See Also:


Attachments
Patch (2.54 KB, patch)
2018-08-14 06:27 PDT, Yusuke Suzuki
no flags Details | Formatted Diff | Diff
Archive of layout-test-results from ews101 for mac-sierra (2.35 MB, application/zip)
2018-08-14 07:32 PDT, EWS Watchlist
no flags Details
Archive of layout-test-results from ews105 for mac-sierra-wk2 (2.82 MB, application/zip)
2018-08-14 07:41 PDT, EWS Watchlist
no flags Details
Patch (9.02 KB, patch)
2018-08-14 07:59 PDT, Yusuke Suzuki
no flags Details | Formatted Diff | Diff
Patch (9.28 KB, patch)
2018-08-14 08:03 PDT, Yusuke Suzuki
youennf: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Yusuke Suzuki 2018-08-14 06:05:24 PDT
...
Comment 1 Yusuke Suzuki 2018-08-14 06:27:05 PDT
Created attachment 347071 [details]
Patch
Comment 2 EWS Watchlist 2018-08-14 07:32:48 PDT
Comment on attachment 347071 [details]
Patch

Attachment 347071 [details] did not pass mac-ews (mac):
Output: https://webkit-queues.webkit.org/results/8854950

New failing tests:
imported/w3c/web-platform-tests/streams/readable-streams/tee.dedicatedworker.html
http/wpt/workers/promise-unhandled-rejection.any.worker.html
js/dom/unhandled-promise-rejection-bindings-type-error-in-workers.html
imported/w3c/web-platform-tests/WebCryptoAPI/derive_bits_keys/ecdh_bits.https.worker.html
imported/w3c/web-platform-tests/WebCryptoAPI/derive_bits_keys/ecdh_keys.https.worker.html
Comment 3 EWS Watchlist 2018-08-14 07:32:50 PDT
Created attachment 347073 [details]
Archive of layout-test-results from ews101 for mac-sierra

The attached test failures were seen while running run-webkit-tests on the mac-ews.
Bot: ews101  Port: mac-sierra  Platform: Mac OS X 10.12.6
Comment 4 EWS Watchlist 2018-08-14 07:41:24 PDT
Comment on attachment 347071 [details]
Patch

Attachment 347071 [details] did not pass mac-wk2-ews (mac-wk2):
Output: https://webkit-queues.webkit.org/results/8854959

New failing tests:
imported/w3c/web-platform-tests/streams/readable-streams/tee.dedicatedworker.html
http/wpt/workers/promise-unhandled-rejection.any.worker.html
js/dom/unhandled-promise-rejection-bindings-type-error-in-workers.html
imported/w3c/web-platform-tests/WebCryptoAPI/derive_bits_keys/ecdh_bits.https.worker.html
imported/w3c/web-platform-tests/WebCryptoAPI/derive_bits_keys/ecdh_keys.https.worker.html
Comment 5 EWS Watchlist 2018-08-14 07:41:26 PDT
Created attachment 347074 [details]
Archive of layout-test-results from ews105 for mac-sierra-wk2

The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews.
Bot: ews105  Port: mac-sierra-wk2  Platform: Mac OS X 10.12.6
Comment 6 Yusuke Suzuki 2018-08-14 07:59:46 PDT
Created attachment 347075 [details]
Patch
Comment 7 Yusuke Suzuki 2018-08-14 08:03:13 PDT
Created attachment 347076 [details]
Patch
Comment 8 youenn fablet 2018-08-14 08:44:19 PDT
Comment on attachment 347076 [details]
Patch

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

> Source/WebCore/dom/ScriptExecutionContext.cpp:-411
> -    logExceptionToConsole(errorMessage, sourceURL, lineNumber, columnNumber, WTFMove(callStack));

Given its name, it seems strange that logExceptionToConsole would actually dispatch an Error event to the worker host.
Is there a way to make things clearer?
Comment 9 Yusuke Suzuki 2018-08-14 10:55:19 PDT
Comment on attachment 347076 [details]
Patch

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

>> Source/WebCore/dom/ScriptExecutionContext.cpp:-411
>> -    logExceptionToConsole(errorMessage, sourceURL, lineNumber, columnNumber, WTFMove(callStack));
> 
> Given its name, it seems strange that logExceptionToConsole would actually dispatch an Error event to the worker host.
> Is there a way to make things clearer?

The interesting is that this `logExceptionToConsole` just logs a message in Document while Worker emits ErrorEvent to the host Worker object.
Yeah, we should have appropriate name. Maybe, notifyException / propagateException / handleException etc.?
I've opened a bug for this. https://bugs.webkit.org/show_bug.cgi?id=188562
Comment 10 Yusuke Suzuki 2018-08-14 10:56:36 PDT
Committed r234857: <https://trac.webkit.org/changeset/234857>
Comment 11 Radar WebKit Bug Importer 2018-08-14 10:57:21 PDT
<rdar://problem/43293557>