I'm trying to cancel a navigation timeout (set by SetNavigationTimeout) without triggering a visible net error as a fix for crbug.com/41488861. I'd appreciate any suggestions that could prevent these noisy error pages for what's supposed to be "silent" upgrades.
Context:
HTTPS-Upgrades feature opportunistically upgrades HTTP navigations HTTPS. If the upgraded HTTPS load takes long, the upgrade is canceled and the original HTTP URL is loaded as a fallback. We call this fast-fallback.
To support fast-fallbacks, we introduced the concept of navigation timeouts:
Presently, an upgraded HTTPS load is initiated with a timeout of 3 seconds. When it times out, the HTTPS upgrade interceptor handles the failed upgrade and initiates a fallback navigation. A fallback navigation is initiated by first allowlisting the HTTP URL (so that it's not upgraded again), then loading it again in the same tab. A URL is also allowlisted if it's part of a redirect chain.
In https://crbug.com/41488861#comment22, a combination of a slow redirect and a redirect loop is causing the net error to be visible for a short while.
As a potential fix, I tried introducing a CancelNavigationTimeout() and calling it on redirects, but obviously this breaks the fast-fallback logic. E.g. If an upgraded URL (https://a.com) redirects to https://slow.com, we won't fast-fallback and the upgrade will hang.
Thanks!
Mustafa
--
You received this message because you are subscribed to the Google Groups "navigation-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to navigation-de...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/navigation-dev/CAHafXh3jWg6ecGk0JjAMZGHt29qG1WAw8DYuK2JpiHSK5oCquA%40mail.gmail.com.
Also, apologies, I used the wrong URL for the "original thread" link. It should be https://groups.google.com/a/chromium.org/g/navigation-dev/c/BrXS3578Vew/m/qLTYANB8CAAJ instead.On Fri, Sep 20, 2024 at 1:58 PM Mustafa Emre Acer <mea...@chromium.org> wrote:Hi Rakina,
> Is the problem about the navigation cancellation that's caused by the navigation timeout commits an error page, while the new navigation is still ongoing?
Yes. And because the timed-out navigation is allowlisted (because it was part of a redirect chain), its error page will show briefly, until the fallback navigation completes.
> Is it possible to use a pre-existing error code for the navigation timeout cancellation, that makes the navigation be silently cancelled instead of committing an error page (e.g. ERR_ABORTED)?
It appears that ERR_ABORTED aborts the whole navigation including subsequent redirects. Is that expected? With ERR_TIMEOUT, SetNavigationTimeout() cancels the current redirect hop, but subsequent navigations (including the fallback navigation) still take place.
Hi Rakina,
> Is the problem about the navigation cancellation that's caused by the navigation timeout commits an error page, while the new navigation is still ongoing?
Yes. And because the timed-out navigation is allowlisted (because it was part of a redirect chain), its error page will show briefly, until the fallback navigation completes.
> Is it possible to use a pre-existing error code for the navigation timeout cancellation, that makes the navigation be silently cancelled instead of committing an error page (e.g. ERR_ABORTED)?
It appears that ERR_ABORTED aborts the whole navigation including subsequent redirects. Is that expected? With ERR_TIMEOUT, SetNavigationTimeout() cancels the current redirect hop, but subsequent navigations (including the fallback navigation) still take place.
On Fri, Sep 20, 2024 at 6:06 AM Rakina Zata Amni <rak...@chromium.org> wrote: