Bug 30336 - Messaging - Subscriber handler runs twice instead of once
Summary: Messaging - Subscriber handler runs twice instead of once
Alias: None
Product: Forms
Classification: Xamarin
Component: Forms ()
Version: 1.4.2
Hardware: Macintosh Mac OS
: Normal normal
Target Milestone: ---
Assignee: Bugzilla
Depends on:
Reported: 2015-05-22 04:02 UTC by BillF
Modified: 2016-12-05 16:42 UTC (History)
7 users (show)

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

Minimal code demonstrating the problem (177.20 KB, application/octet-stream)
2015-06-20 05:27 UTC, BillF

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:

Description BillF 2015-05-22 04:02:44 UTC
1. Page A is on a navigationpage stack.
2. Page A pushes page B onto the navigationpage stack. Page B's constructor subscribes to a message.
3. Page B pushes Page C onto the navigation stack. Page C's OnDisappearing routine sends a message to the subscriber on Page B and pops back to Page B. All good, Page B's message handler is called.
4. Page B pops back to page A. (Page B's destructor unsubscribes, but this seems to be irrelevant.)
5. Steps 2 and 3 are repeated. This time Page B's message handler is called twice, not once as it should be.

Sorry unable atm to provide a simple code example but hopefully straightforward to reproduce.
Comment 1 Chris King 2015-05-26 17:10:14 UTC
We'd be happy to help you resolve this issue. Please help us by attaching a reduced reproduction to the bug by starting with a clean Xamarin.Forms project and adding just the code necessary to demonstrate the issue. If you'd do this for us we would very much appreciate it. If you are able to reproduce the issue without modifying the platform specific projects that would eliminate a number of possibilities and likely expedite a resolution. 

Warm regards,
Xamarin Forms Team
Comment 2 BillF 2015-06-20 05:27:09 UTC
Created attachment 11696 [details]
Minimal code demonstrating the problem


Have attached a minimal sample app BugTest that demonstrates the problem reproducibly.

Place a breakpoint in the GroupsPage message handler then tap the following:

Click Me
Groups [ Here the breakpoint, correctly, is reached once]
Click Me
Click Me
Groups [ Here the breakpoint, incorrectly, is reached twice]


Comment 4 Paul DiPietro [MSFT] 2016-12-05 16:42:14 UTC
This no longer appears to be occurring with the reproduction as of the latest stable (2.3.3) release.