Bug 35818 - UriIMageSource not working with caching enabled, and sometimes does not work with caching disabled.
Summary: UriIMageSource not working with caching enabled, and sometimes does not work ...
Status: RESOLVED NOT_REPRODUCIBLE
Alias: None
Product: Forms
Classification: Xamarin
Component: Forms ()
Version: 1.5.1
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2015-11-12 15:49 UTC by Jon Goldberger [MSFT]
Modified: 2016-12-20 19:55 UTC (History)
6 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:


Attachments
Test Project (460.71 KB, application/zip)
2015-11-12 15:49 UTC, Jon Goldberger [MSFT]
Details


Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED NOT_REPRODUCIBLE

Description Jon Goldberger [MSFT] 2015-11-12 15:49:20 UTC
Created attachment 13798 [details]
Test Project

## Description

When setting an Image.Source to a UriImageSource with caching enabled, image never shows up. When disabling caching with:
`uriImageSource.CachingEnabled = false;`
then the image appears most of the time, but not always. 

Screencast (iOS simulator): http://screencast.com/t/HxSp0P4O


In the screencast, the first time I launch the app it is with caching enabled. The image never appears. I then disable caching and re-luanch the app. The first 3 times I re-launch, the image appears but fails to show the 4th time I re-launch the app. 

There is a forum post about this as well, but on the thread one poster resolved the issue by disabling caching for the UriImageSource but did not note if the issue still occurred sometimes as was reported in the desk case from the customer reporting this issue to support. (link in private comment below). 

The reporting customer also noted the issue occurred on Android and iOS, device or simulator, but I was only able to reproduce on iOS. 

## Steps to reproduce

1. Open the attached test project in XS (Current Stable builds)

2. Set the iOS project as the startup project. 

3. Launch to an iOS device or simulator (tested on iPhone 6 and 6s/iOS 9.1 simulators)

Expected result: Two identical images should be displayed, one under label "Web" and another under label "Local"

Actual result: Only local image is displayed. 

4. Now uncomment line 13 `uriImageSource.CachingEnabled = false;` in TestImage.cs in the TestImage project 

5. Re-launch app (repeat until issue occurs)

Expected result: Web image will always show.

Actual result: Occasionally the image does not show (See above screencast). In my tests, sometimes I had to re-launch ten times to get the issue to occur. 

## Notes

I am not able to reproduce this issue using an image from my own personal web server, so it might be a URL parsing issue? The URL that is showing this issue in the test project has a colon in it, whereas there is no colon in the URL for the image on my personal web server. 


## Version Information

Forms 1.5.1.6471

=== Xamarin Studio ===

Version 5.9.8 (build 0)
Installation UUID: 964c531b-d928-456b-a9ae-e1f82266b360
Runtime:
	Mono 4.0.5 ((detached/1d8d582)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 400050001

=== Xamarin.Android ===

Version: 5.1.9.0 (Business Edition)
Android SDK: /Users/apple/Library/Developer/Xamarin/android-sdk-mac_x86
	Supported Android versions:
		4.0.3 (API level 15)
		4.1   (API level 16)
		4.2   (API level 17)
		4.3   (API level 18)
		4.4   (API level 19)
		5.0   (API level 21)
		5.1   (API level 22)
		6.0   (API level 23)
Java SDK: /usr
java version "1.7.0_79"
Java(TM) SE Runtime Environment (build 1.7.0_79-b15)
Java HotSpot(TM) 64-Bit Server VM (build 24.79-b02, mixed mode)

=== Xamarin Android Player ===

Version: Unknown version
Location: /Applications/Xamarin Android Player.app

=== Apple Developer Tools ===

Xcode 7.1.1 (9081)
Build 7B1005

=== Xamarin.iOS ===

Version: 9.1.0.31 (Business Edition)
Hash: bae2cdb
Branch: master
Build date: 2015-11-09 17:44:57-0500

=== Xamarin.Mac ===

Version: 2.0.2.111 (Business Edition)

=== Build Information ===

Release ID: 509080000
Git revision: cc5f6e5658589ca7f46210c57fad947e75f30abd
Build date: 2015-10-21 19:27:41-04
Xamarin addins: d77f191bd7d3451adf837b85b38f2b7c60004400

=== Operating System ===

Mac OS X 10.11.1
Darwin Jons-iMac.local 15.0.0 Darwin Kernel Version 15.0.0
    Sat Sep 19 15:53:46 PDT 2015
    root:xnu-3247.10.11~1/RELEASE_X86_64 x86_64
Comment 2 Jon Goldberger [MSFT] 2015-11-12 15:52:17 UTC
Oops, forgot to add link to forum post: https://forums.xamarin.com/discussion/19828/xamarin-forms-image-not-picking-up-a-remote-image-on-ios
Comment 3 Matthieu GD 2015-11-26 08:45:10 UTC
Any news on this bug ?
Comment 7 Samantha Houts [MSFT] 2016-12-20 19:55:48 UTC
I ran this project without alteration on iPhone 6 9.3 simulators and iPhone 6 10.2 device, and the images both appeared every time, with or without the caching disabled. I wonder if this was an issue with the simulators or an upstream issue resolved in a later version of Xamarin.iOS...?

In any case, if you continue to experience this issue, please reopen this report with additional information.

Warm regards,
Xamarin Forms Team