WinUI Image Downloads Can Stall for an Hour After a Connection Drops
A missing receive timeout in Microsoft's WinUI can leave an image download stalled for up to an hour when the network connection drops. A proposed fix sets a 30-second receive timeout.
Image downloads had no receive timeout
WinUI's BitmapImage class is widely used to load images from a URL. It is designed to raise ImageOpened after a successful load or ImageFailed if loading fails. Apps use those events to decide whether to show the image or an error.
When the connection stopped transferring data partway through a download, neither event arrived for a long time.
On March 25, 2026, an app developer using Windows App SDK 1.6 reported the bug. Their app loaded about 20 images from a content delivery network (CDN). The downloads stalled after the network dropped and did not resume when it recovered. Without ImageFailed, the app had no event to trigger an error message or retry.
A proposed fix published November 27 identified the cause. The internal image download class CWindowsDownloadRequest did not implement the urlmon URL retrieval library's IWinInetHttpTimeouts interface. At the start of each download, urlmon tried to retrieve the receive timeout through that interface. With no implementation, the request received no timeout of its own. A stalled request could wait for WinINet's internal cleanup, which took 3,600 seconds, before ImageFailed fired. Reporting a failure could take an hour.
The impact went beyond a single image. WinINet limits concurrent connections to a host. For a group of images from the same CDN, stalled downloads can occupy the available connections and keep later downloads from starting. That explains why the reporter's app failed to load its image gallery.
A 30-second receive timeout
The proposed fix adds an implementation in CWindowsDownloadRequest of IWinInetHttpTimeouts and returns a 30-second receive timeout. This matches WinINet's default receive timeout, while connect and send timeouts remain at the existing default setting of 0. urlmon ends stalled downloads through the existing OnStopBinding path, so the change requires no new timer or retry logic.
If no data is received for 30 seconds, ImageFailed fires and the connection is released. A download that continues receiving data can still run for longer than 30 seconds.
In the developer's tests using an app that displayed six images, stalled requests left the gallery incomplete after 150 seconds before the fix. With the patch, the stalled requests failed about 33.5 to 34.2 seconds after the app started, and the remaining images loaded immediately. Slow downloads that continued receiving data loaded in both versions.
Image download test with stalled requests
| Before the fix | After the fix | |
|---|---|---|
| Receive timeout | None | 30 seconds |
| Stalled image failure notification | Still absent after 150 seconds | About 33.5–34.2 seconds |
| Loading the remaining four images | Did not start | Completed immediately after the failures |
The proposed fix does not add automatic retries. Retrying the same URL just after a failure returns the cached failure while the original BitmapImage instance is still alive. This also happens with a 404 and was already part of the existing behavior.
As of November 28, the fix was still a draft and had no new automated tests. The proposal says testing would require an HTTP server that stops sending data partway through a response.
KioskNews shows a cleaned-up reading view extracted from the publisher’s page — the original always lives on their site, not ours.
