Open Bug 1534311 Opened 5 months ago Updated 5 months ago

Allow auth prompt for "save link as" and just stop the timer that would cancel the initial request


(Toolkit :: Downloads API, enhancement, P3)




Tracking Status
firefox67 --- affected


(Reporter: Gijs, Unassigned)



See bug 1529901.

In,1171 , we try to follow a link to get content type headers. If the link requires authentication, we stop trying to connect.

This is because there is a fallback here, where if the initial connection doesn't respond within 4 seconds ( ) we time out the request to get the content type headers ( ).

In bug 597374, Honza fixed this so that if we require auth, we cancel the timer and immediately start the "back up" version, which will first prompt for a filename and then do the request, prompt for auth etc.

From bug 597374, I don't really understand why we decided to fix this this way. That is, why can't we instead prompt for auth normally and cancel the "backup" timer - the auth prompt can function as the user's "it worked" UX feedback, ie we tried to follow the link to save it, and now we're prompting for auth. Honza, can you check if I'm missing something?

Flags: needinfo?(honzab.moz)

I think it was "too complex": [1] We could somewhat adapt one part of patch v1 from that bug that was r-'ed [2].

that patch cancels the timer when auth is requested, allows the prompt, but doesn't renew the timer (so the bug would be there again) after credentials were entered.

if we wrap the nsIPromptFactory object the callbacks impl returns from getInterface with our own and let it then wrap the |callback| argument of asyncPrompAuth (called from [3]) with an intermediary implementation of nsIAuthPromptCallback, we could restart the timer from the call to onAuthAvailable after the user accepted the credentials.


Flags: needinfo?(honzab.moz)
Priority: -- → P3
You need to log in before you can comment on or make changes to this bug.