Skip to content
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

PBjs Core Ajax: if xfr.open() explodes it lets the caller know #7161

Merged
merged 1 commit into from
Jul 27, 2021

Conversation

jimdigriz
Copy link
Contributor

For example, IE11 explodes on .open for deleted URLs created from URL.createObjectURL.

Type of change

  • Bugfix

Description of change

When XFR is upset, do not just silently die and stall the caller but use the callback error handler from inside catch.

IE11 explodes on .open for deleted URLs created from URL.createObjectURL
@jimdigriz
Copy link
Contributor Author

No idea why CircleCI is failing, for me to look I need to give it read/write access to everything which I am not prepared to do.

Running the tests locally Works for Me(tm) though:

alex@aineko:~/src/adloox/Prebid.js$ gulp test --nolintfix
[14:16:53] Using gulpfile ~/src/adloox/Prebid.js/gulpfile.js
[14:16:53] Starting 'test'...
[14:16:53] Starting 'clean'...
[14:16:53] Finished 'clean' after 21 ms
[14:16:53] Starting 'lint'...
[14:17:13] Finished 'lint' after 20 s
[14:17:13] Starting 'test'...
10 07 2021 14:17:13.483:WARN [karma-server]: Passing raw CLI options to `new Server(config, done)` is deprecated. Use `parseConfig(configFilePath, cliOptions, {promiseConfig: true, throwErrors: true})` to prepare a processed `Config` instance and pass that as the `config` argument instead.

START:
⚠ 「wdm」: 
ℹ 「wdm」: Compiled with warnings.
ℹ 「wdm」: Compiling...
⚠ 「wdm」: 
ℹ 「wdm」: Compiled with warnings.
10 07 2021 14:17:50.522:INFO [karma-server]: Karma v6.3.4 server started at http://localhost:9876/
10 07 2021 14:17:50.523:INFO [launcher]: Launching browsers ChromeHeadless with concurrency 5
10 07 2021 14:17:50.635:INFO [launcher]: Starting browser ChromeHeadless
10 07 2021 14:17:51.575:INFO [Chrome Headless 91.0.4472.114 (Linux x86_64)]: Connected on socket smZJCFEc71FROUkDAAAB with id 67060951
INFO: '%cPrebid', 'display: inline-block; color: #fff; background: #3b88c3; padding: 1px 4px; border-radius: 3px;', 'INFO:', 'BidRequest: {"id":"437fbbf5-33f5-487a-8e16-a7112903cfe5","source":{"tid":"437fbbf5-33f5-487a-8e16-a7112903cfe5"},"tmax":1000,"imp":[{"id":"div-gpt-ad-1460505748561-0","ext":{"appnexus":{"member":"123","use_pmt_rule":false,"placement_id":10433394},"prebid":{"storedauctionresponse":{"id":"11111"}}},"banner":{"format":[{"w":300,"h":250},{"w":300,"h":300}]},"native":{"request":"{\"context\":1,\"plcmttype\":1,\"eventtrackers\":[{\"event\":1,\"methods\":[1]}],\"assets\":[{\"required\":1,\"title\":{\"len\":800}},{\"required\":1,\"img\":{\"type\":3,\"w\":989,\"h\":742}},{\"required\":1,\"img\":{\"type\":1,\"wmin\":10,\"hmin\":10,\"ext\":{\"aspectratios\":[\"1:1\"]}}},{\"required\":1,\"data\":{\"type\":1}}]}","ver":"1.2"}}],"test":0,"ext":{"prebid":{"auctiontimestamp":1510852447530,"targeting":{"includewinners":true,"includebidderkeys":false},"channel":{"name":"pbjs","version":"v5.4.0"},"debug":true}},"site":{"publisher":{"id":"1"},"page":"http://mytestpage.com"},"device":{"w":100,"h":100}}'
LOG: [Object{method: 'GET', url: 'https://api.relaido.jp/bid/v1/prebid/100000', data: Object{version: ..., timeout_ms: ..., ad_unit_code: ..., auction_id: ..., bidder: ..., bidder_request_id: ..., bid_requests_count: ..., bid_id: ..., transaction_id: ..., media_type: ..., uuid: ..., width: ..., height: ..., ref: ...}, options: Object{withCredentials: ...}, bidId: '2ed93003f7bb99', player: undefined, width: 1, height: 1, mediaType: 'banner'}]

Finished in 7.443 secs / 4.843 secs @ 14:18:00 GMT+0100 (British Summer Time)

SUMMARY:
✔ 7007 tests completed
ℹ 11 tests skipped
[14:18:00] Finished 'test' after 47 s
[14:18:00] Finished 'test' after 1.1 min

Also running the tests through BrowserStack Works For Me(tm):

alex@aineko:~/src/adloox/Prebid.js$ gulp test --browserstack --nolintfix
[14:19:40] Using gulpfile ~/src/adloox/Prebid.js/gulpfile.js
[14:19:40] Starting 'test'...
[14:19:40] Starting 'clean'...
[14:19:40] Finished 'clean' after 19 ms
[14:19:40] Starting 'lint'...
[14:20:00] Finished 'lint' after 20 s
[14:20:00] Starting 'test'...
10 07 2021 14:20:00.813:WARN [karma-server]: Passing raw CLI options to `new Server(config, done)` is deprecated. Use `parseConfig(configFilePath, cliOptions, {promiseConfig: true, throwErrors: true})` to prepare a processed `Config` instance and pass that as the `config` argument instead.
⚠ 「wdm」: 
ℹ 「wdm」: Compiled with warnings.
ℹ 「wdm」: Compiling...
⚠ 「wdm」: 
ℹ 「wdm」: Compiled with warnings.
10 07 2021 14:20:37.089:INFO [karma-server]: Karma v6.3.4 server started at http://localhost:9876/
10 07 2021 14:20:37.090:INFO [launcher]: Launching browsers bs_edge_17_windows_10, bs_edge_90_windows_10, bs_ie_11_windows_10, bs_chrome_90_windows_10, bs_chrome_79_windows_10, bs_firefox_88_windows_10, bs_firefox_72_windows_10, bs_safari_14_mac_bigsur, bs_safari_12_mac_mojave with concurrency 5
10 07 2021 14:20:37.173:INFO [launcher]: Starting browser edge 17.0 (Windows 10) on BrowserStack
10 07 2021 14:20:37.173:INFO [launcher]: Starting browser edge 90.0 (Windows 10) on BrowserStack
10 07 2021 14:20:37.174:INFO [launcher]: Starting browser ie 11.0 (Windows 10) on BrowserStack
10 07 2021 14:20:37.174:INFO [launcher]: Starting browser chrome 90.0 (Windows 10) on BrowserStack
10 07 2021 14:20:37.175:INFO [launcher]: Starting browser chrome 79.0 (Windows 10) on BrowserStack
[SNIPPED]
Edge 17.17134 (Windows 10): Executed 7007 of 7014 (skipped 11) SUCCESS (20.866 secs / 11.549 secs)
IE 11.0 (Windows 10): Executed 7007 of 7014 (skipped 11) SUCCESS (25.738 secs / 17.234 secs)
Chrome 90.0.4430.72 (Windows 10): Executed 7007 of 7014 (skipped 11) SUCCESS (13.431 secs / 7.412 secs)
Chrome 79.0.3945.79 (Windows 10): Executed 7007 of 7014 (skipped 11) SUCCESS (14.412 secs / 7.977 secs)
Edge 90.0.818.39 (Windows 10): Executed 7007 of 7014 (skipped 11) SUCCESS (16.147 secs / 8.986 secs)
Firefox 88.0 (Windows 10): Executed 7007 of 7014 (skipped 11) SUCCESS (17.63 secs / 9.913 secs)
Firefox 72.0 (Windows 10): Executed 7007 of 7014 (skipped 11) SUCCESS (15.937 secs / 9.44 secs)
Safari 14.1.1 (Mac OS 10.15.7): Executed 2815 of 7014 (skipped 8) SUCCESS (4.247 secs / 2.711 secs)
Safari 12.1.2 (Mac OS 10.14.6): Executed 7007 of 7014 (skipped 11) SUCCESS (18.529 secs / 12.724 secs)
TOTAL: 58871 SUCCESS

[14:27:06] Finished 'test' after 7.08 min
[14:27:06] Finished 'test' after 7.42 min

@ChrisHuie
Copy link
Collaborator

reran tests on this pr and we should be good.

@ChrisHuie ChrisHuie changed the title ajax: if xfr.open() explodes let the caller know PBjs Core Ajax: if xfr.open() explodes it lets the caller know Jul 12, 2021
@ChrisHuie ChrisHuie requested a review from osazos July 12, 2021 15:48
@jimdigriz
Copy link
Contributor Author

Can I do anything to help the review process? This blocks me on pushing forward on #6309 and #6310.

src/ajax.js Show resolved Hide resolved
@osazos osazos self-requested a review July 27, 2021 07:59
Copy link
Collaborator

@osazos osazos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@osazos osazos merged commit 7a2ca92 into prebid:master Jul 27, 2021
@jimdigriz jimdigriz deleted the fix/ajax-exception branch July 27, 2021 17:26
prebidtappx pushed a commit to prebidtappx/Prebid.js that referenced this pull request Nov 15, 2021
IE11 explodes on .open for deleted URLs created from URL.createObjectURL
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants