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

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


Attachments
Minimal code demonstrating the problem (177.20 KB, application/octet-stream)
2015-06-20 05:27 UTC, BillF
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 FIXED

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

Hi

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

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

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

Cheers

Bill.
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.