Bug 258412 - Streaming Responses generated from a ServiceWorker are mis-reported as 0kb by the download manager on iOS, works correctly on macOS
Summary: Streaming Responses generated from a ServiceWorker are mis-reported as 0kb by...
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Service Workers (show other bugs)
Version: Safari 16
Hardware: iPhone / iPad iOS 16
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2023-06-22 11:54 PDT by Nathan
Modified: 2023-06-22 13:02 PDT (History)
3 users (show)

See Also:


Attachments
Screenshot of the iOS download manager reporting the download size as 0kb instead of reading and reporting the Content-length header (175.86 KB, image/png)
2023-06-22 11:54 PDT, Nathan
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Nathan 2023-06-22 11:54:21 PDT
Created attachment 466798 [details]
Screenshot of the iOS download manager reporting the download size as 0kb instead of reading and reporting the Content-length header

For Response's who's bodies are ReadableStreams onn iOS, the file size is reported as 0kb and the progress is shown as indeterminate until the download completes. The downloaded file is usable, so this is a cosmetic bug in the download manager. We have seen bug reports for our app where people mistook this cosmetic bug as a download failure.

On macOS, the reported size is correct and the % progress is reported correctly during the download.

I've created a demonstration repo which streams a .txt file out as a download which reproduces the problem, and includes screenshots of the download managers for iOS and macOS.

https://github.com/shareup/streaming-service-worker-download-content-length-bug

Also, thank you all for introducing streaming ServiceWorker downloads in Safari 15.4 ❤️
Comment 1 Radar WebKit Bug Importer 2023-06-22 13:02:22 PDT
<rdar://problem/111177426>