Bug 24928 - Quickly clicking on button in Android causes page to be duplicated, doesn't occur in iOS
Summary: Quickly clicking on button in Android causes page to be duplicated, doesn't o...
Status: RESOLVED ANSWERED
Alias: None
Product: Forms
Classification: Xamarin
Component: Forms ()
Version: 1.3.0
Hardware: PC Mac OS
: Normal normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2014-11-28 20:41 UTC by Kent Green [MSFT]
Modified: 2015-02-13 21:05 UTC (History)
4 users (show)

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


Attachments
Sample & logs (2.32 MB, application/zip)
2014-11-28 20:41 UTC, Kent Green [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 ANSWERED

Description Kent Green [MSFT] 2014-11-28 20:41:08 UTC
Created attachment 8907 [details]
Sample & logs

---Overview---
From this desk case:
https://xamarin.desk.com/agent/case/105709

Screencast of bug:
http://screencast.com/t/6ipncFeShF

Customer noted that when quickly tapping a button to navigate to a new page in Android the page could be triggered twice, which causes unexpected behavior when backing out of the loaded screen as a second, not completely loaded version of the page would appear in the back stack. 

They also noted that it can be possible to cause a similar behavior by rapidly tapping two different links; with the difference being that two different pages are added; rather than two copies of the same page.

This issue is reproducible with the Xamarin.Forms Control Gallery sample. I've included the version I've used to test the issue with for consistency.

---Steps to reproduce---
1. Run the app in an Android emulator or device.
2. Rapidly tap the same button (or different buttons) twice, causing the page duplication.
Note: I was unable to reproduce the issue 100% of the time, as shown in the video. This is likely because it is timing sensitive. However; it is generally reproducible within a few tries.

---Expected Behavior---
Only one page should be added to the view & back stack.

---Actual Behavior---
Two pages are added to the back stack.

---Build Information---
=== Xamarin Studio ===

Version 5.5.4 (build 15)
Installation UUID: 8ef63a7c-1b18-40de-a334-7f78777fcb55
Runtime:
	Mono 3.10.0 ((detached/92c4884)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 310000031

=== Xamarin.Android ===

Version: 4.20.0.28 (Business Edition)
Android SDK: /Users/kentgreen/Library/Developer/Xamarin/android-sdk-macosx
	Supported Android versions:
		2.1   (API level 7)
		2.2   (API level 8)
		2.3   (API level 10)
		3.1   (API level 12)
		4.0   (API level 14)
		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)
Java SDK: /usr
java version "1.8.0_25"
Java(TM) SE Runtime Environment (build 1.8.0_25-b17)
Java HotSpot(TM) 64-Bit Server VM (build 25.25-b02, mixed mode)

=== Apple Developer Tools ===

Xcode 6.1 (6604)
Build 6A1052d

=== Xamarin.Mac ===

Version: 1.10.0.18 (Business Edition)

=== Xamarin.iOS ===

Version: 8.4.0.43 (Business Edition)
Hash: 840a925
Branch: 
Build date: 2014-11-16 21:03:22-0500

=== Build Information ===

Release ID: 505040015
Git revision: f93940a35458a18052f1a25e106e62ca970d9c40
Build date: 2014-11-19 15:32:41-05
Xamarin addins: dc23cbd91a3a0e1d326328e1229e86c942a49ec8

=== Operating System ===

Mac OS X 10.10.1
Darwin Kents-MacBook-Pro-2.local 14.0.0 Darwin Kernel Version 14.0.0
    Fri Sep 19 00:26:44 PDT 2014
    root:xnu-2782.1.97~2/RELEASE_X86_64 x86_64

---Additional Info---
I wasn't able to pin down the definite cause of the issue; but I reasoned that since the behavior worked as expected in iOS but not Android with the same Forms code; this would be the appropriate place to file the issue. 

Please recategorize if appropriate.
Comment 1 Sunil Kumar 2014-12-01 07:36:58 UTC
We have tried to reproduce this issue but after running the attached sample, a black screen displays and we are not getting the option list shown as in attached screencast. We have run this sample on device and emulator and getting the same issue.

Here is the screencast for the same: http://www.screencast.com/t/p89S0a28Uk7

Should I have to update anything in sample so that it runs like as you have shown in screencast?

also if possible, could you please provide us Android device log (For Android device log: XS->view->pads->Android Log->Choose device and Click on Connect Button)
Comment 2 Sunil Kumar 2014-12-01 07:47:50 UTC
Environment info:
=== Xamarin Studio ===

Version 5.7 (build 596)
Installation UUID: 561c7a69-0a91-4bae-ad7c-f0c79d594337
Runtime:
	Mono 3.12.0 ((detached/b75fa2b)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 312000046

=== Apple Developer Tools ===

Xcode 5.1.1 (5085)
Build 5B1008

=== Xamarin.iOS ===

Version: 8.6.0.5 (Trial Edition)
Hash: 880cc21
Branch: 
Build date: 2014-11-25 12:12:17-0500

=== Xamarin.Android ===

Version: 5.0.0.0 (Trial Edition)
Android SDK: /Users/tajinder/Desktop/android-sdk-macosx
	Supported Android versions:
		2.3    (API level 10)
		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)
		4.4.87 (API level 20)
		5.0    (API level 21)
Java SDK: /usr
java version "1.7.0_67"
Java(TM) SE Runtime Environment (build 1.7.0_67-b01)
Java HotSpot(TM) 64-Bit Server VM (build 24.65-b04, mixed mode)

=== Xamarin.Mac ===

Version: 1.11.1.201 (Indie Edition)

=== Build Information ===

Release ID: 507000596
Git revision: d996e9ba6874a0d64241e43e5e6b06322ce29c84
Build date: 2014-11-25 17:17:54-05
Xamarin addins: 8ca19707b41536a391f53364ee4ff9272711feb0

=== Operating System ===

Mac OS X 10.8.4
Darwin Tajinders-iMac.local 12.4.2 Darwin Kernel Version 12.4.2
    Mon Jun 17 18:00:12 PDT 2013
    root:xnu-2050.45.8~1/RELEASE_X86_64 x86_64
Comment 3 Kent Green [MSFT] 2014-12-05 13:16:59 UTC
I retested the downloaded project to verify it is correct, and I am still able to build the project and reproduce the error with the following build:

=== Xamarin Studio ===

Version 5.5.4 (build 15)
Installation UUID: 8ef63a7c-1b18-40de-a334-7f78777fcb55
Runtime:
	Mono 3.10.0 ((detached/92c4884)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 310000031

=== Xamarin.Android ===

Version: 4.20.0.28 (Business Edition)
Android SDK: /Users/kentgreen/Library/Developer/Xamarin/android-sdk-macosx
	Supported Android versions:
		2.1   (API level 7)
		2.2   (API level 8)
		2.3   (API level 10)
		3.1   (API level 12)
		4.0   (API level 14)
		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)
Java SDK: /usr
java version "1.8.0_25"
Java(TM) SE Runtime Environment (build 1.8.0_25-b17)
Java HotSpot(TM) 64-Bit Server VM (build 25.25-b02, mixed mode)

=== Apple Developer Tools ===

Xcode 6.1 (6604)
Build 6A1052d

=== Xamarin.Mac ===

Version: 1.10.0.18 (Business Edition)

=== Xamarin.iOS ===

Version: 8.4.0.43 (Business Edition)
Hash: 840a925
Branch: 
Build date: 2014-11-16 21:03:22-0500

=== Build Information ===

Release ID: 505040015
Git revision: f93940a35458a18052f1a25e106e62ca970d9c40
Build date: 2014-11-19 15:32:41-05
Xamarin addins: dc23cbd91a3a0e1d326328e1229e86c942a49ec8

=== Operating System ===

Mac OS X 10.10.1
Darwin Kents-MacBook-Pro-2.local 14.0.0 Darwin Kernel Version 14.0.0
    Fri Sep 19 00:26:44 PDT 2014
    root:xnu-2782.1.97~2/RELEASE_X86_64 x86_64

---

Based on your version information; it looks like you may be on the alpha or beta update channel. Please try testing the sample in the latest stable release. It might also be possible that using the Trial edition to test the issue might be introducing other unexpected issues.

In my repo steps, I primarily tested and repoed the issue in the Xamarin Android Player, like you were using; so there is no info in the device log; since that only applies when using a device.
Comment 4 Jason Smith [MSFT] 2015-02-13 21:05:20 UTC
The task returned is an awaitable so you can await. It is up to the user not to call push multiple times in a row. We are speccing a method of checking if navigation is in progress but they can implement this themselves already.