Open
Conversation
| logcat { "Download $fileName failed during HTTP/1.1 retry" } | ||
| downloadCallback.onError(url = url, downloadId = downloadId, reason = ConnectionRefused) | ||
| directory.getOrCreate(fileName).delete() | ||
| } |
Contributor
There was a problem hiding this comment.
HTTP/1.1 retry error handling discards actual failure reason
Low Severity
When the HTTP/1.1 fallback download fails, the else branch hardcodes ConnectionRefused as the error reason instead of extracting it from retryResult. Since retryResult can be a DownloadResult.Error containing a different reason (like Other when writing to disk fails), the actual failure reason is lost. This causes users to see downloadsErrorMessage instead of downloadsDownloadGenericErrorMessage for disk-write failures, showing an incorrect error message.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Task/Issue URL: https://app.asana.com/1/137249556945/project/488551667048375/task/1211134676219652?focus=true
Description
Added User-Agent header to file downloads to ensure proper handling by servers. This PR:
userAgentparameter to thePendingFileDownloadclassSteps to test this PR
File Downloads
NO UI changes
Note
Ensures servers receive a proper
User-Agentduring downloads and adds a resilient fallback when HTTP/2 breaks.userAgenttoPendingFileDownloadand threads it through workers (FileDownloadWorker), receivers, and callers (BrowserTabFragment, DuckChat, Subscriptions)DownloadFileServiceto sendUser-Agentfor bothHEADand streamingGETApiRequestInterceptorto skip addingUser-Agentif already present and to use WebView UA for re-query pixels@Named("downloadsHttp1")) and DI wiring; provides@Named("http1Fallback")DownloadFileServiceUrlFileDownloaderto include UA, handleStreamResetException, and retry via HTTP/1.1 client; cleans up on cancel/failureWritten by Cursor Bugbot for commit f4cba05. This will update automatically on new commits. Configure here.