Skip to content

Commit

Permalink
[OOBE] Handle net::ERR_ABORTED in TOS webview
Browse files Browse the repository at this point in the history
When a webview is reloading, net::ERR_ABORTED error is thrown to stop
the previous request and start a new one.

Currently we show the error screen without checking the kind of error
which results in error being shown if we retry or the system attempts to
load/refresh the UI automatically soon after initiating it earlier.

This is a temporary fix. A more comprehensive fix would require that we
keep track of current state of request and only initiate a new one when
previous one has completed or failed with an error. A similar approach
is used by oobe_eula.js

(cherry picked from commit 4741777)

Bug: b:232177321
Bug: b:232592745
Test: deploy to DUT, reset to OOBE flow, login and validate TOS load
Change-Id: I2a4031f19a4297ab30a93d4eaa64fb63db5f7033
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3645553
Reviewed-by: Alexander Alekseev <alemate@chromium.org>
Reviewed-by: Yury Khmel <khmel@chromium.org>
Commit-Queue: Muhammad Hasan Khan <mhasank@chromium.org>
Cr-Original-Commit-Position: refs/heads/main@{#1003458}
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3649500
Reviewed-by: Roman Sorokin <rsorokin@chromium.org>
Auto-Submit: Muhammad Hasan Khan <mhasank@chromium.org>
Cr-Commit-Position: refs/branch-heads/5060@{#22}
Cr-Branched-From: b83393d-refs/heads/main@{#1002911}
  • Loading branch information
hasankhan authored and Chromium LUCI CQ committed May 16, 2022
1 parent 87947c8 commit 8480ea6
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -683,6 +683,11 @@ class ArcTermsOfService extends ArcTermsOfserviceBase {
WebViewHelper.loadUrlContentToWebView(
webView, TERMS_URL, WebViewHelper.ContentType.HTML);
return;
} else if (details && details.error == 'net::ERR_ABORTED') {
// Retry triggers net::ERR_ABORTED, so ignore it.
// TODO(b/232592745): Replace with a state machine to handle aborts
// gracefully and avoid duplicate reloads.
return;
}
this.showError_();
}
Expand Down

0 comments on commit 8480ea6

Please sign in to comment.