Bug 51703 - MessagingCenter.Unsubscribe unsubbs ALL instances that has subscribed to the message
Summary: MessagingCenter.Unsubscribe unsubbs ALL instances that has subscribed to the ...
Status: RESOLVED FIXED
Alias: None
Product: Forms
Classification: Xamarin
Component: Forms (show other bugs)
Version: 2.3.4
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2017-01-23 14:12 UTC by Björn Bentmar
Modified: 2017-01-24 22:43 UTC (History)
6 users (show)

See Also:
Tags: 2.3.4.184 pre1 ac
Is this bug a regression?: Yes
Last known good build: 2.3.4.171 pre1


Attachments
Reproduction_Project_MessaginCenter_Bug (237.23 KB, application/zip)
2017-01-23 14:12 UTC, Björn Bentmar
Details

Description Björn Bentmar 2017-01-23 14:12:55 UTC
Created attachment 19443 [details]
Reproduction_Project_MessaginCenter_Bug

My System:

---------------------------------------------------------------------------------------

Microsoft Visual Studio Enterprise 2015
Version 14.0.25431.01 Update 3
Microsoft .NET Framework
Version 4.6.01586

Installed Version: Enterprise

Visual Basic 2015   00322-80000-00000-AA424
Microsoft Visual Basic 2015

Visual C# 2015   00322-80000-00000-AA424
Microsoft Visual C# 2015

Visual C++ 2015   00322-80000-00000-AA424
Microsoft Visual C++ 2015

Application Insights Tools for Visual Studio Package   7.17.00119.9
Application Insights Tools for Visual Studio

ASP.NET and Web Tools 2015.1 (Beta8)   14.1.11107.0
ASP.NET and Web Tools 2015.1 (Beta8)

ASP.NET Web Frameworks and Tools 2012.2   4.1.41102.0
For additional information, visit http://go.microsoft.com/fwlink/?LinkID=309563

ASP.NET Web Frameworks and Tools 2013   5.2.40314.0
For additional information, visit http://www.asp.net/

Common Azure Tools   1.8
Provides common services for use by Azure Mobile Services and Microsoft Azure Tools.

JavaScript Language Service   2.0
JavaScript Language Service

JavaScript Project System   2.0
JavaScript Project System


Microsoft Azure Mobile Services Tools   1.4
Microsoft Azure Mobile Services Tools

Mono Debugging for Visual Studio   Mono.Debugging.VisualStudio
Support for debugging Mono processes with Visual Studio.

NuGet Package Manager   3.4.4
NuGet Package Manager in Visual Studio. For more information about NuGet, visit http://docs.nuget.org/.


Xamarin   4.3.0.550 (ff5ef6d)
Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.

Xamarin Inspector Support   1.0.0.0 (1f3067d)
Adds support for inspecting Xamarin and WPF apps.

Xamarin.Android   7.1.0.19 (3d959b6)
Visual Studio extension to enable development for Xamarin.Android.

Xamarin.iOS   10.4.0.67 (6a925ff)
Visual Studio extension to enable development for Xamarin.iOS.

---------------------------------------------------------------------------------------

The Bug (Actual Behaviour):
My projects creates objects that subscribe to a specific message via MessagingCenter. Add some subscribers and send the message and look at the output. Remove ONE subcriber and send the message again, Now all other instances of subscribers dont get the message, and they didnt unsubscribe. So in short, the bug is that when you unsubscribe from a message with MessagingCenter, all instances that subscribed to it will also be unsubscribed (not shure whats happening deep down in code but they dontget the message).

Expected behaviour:
Add 4 subscrubers, send message, look at output and see 4x messages received, remove a subscriber, send a message, look at output and see 3x messages received. 

Info:
This bug came in the latest prerelease of XF 2.3.4.184 pre 1, the prior prerelase that was removed (XF 2.3.4.171 pre1) does not have this bug. I have tested on android only (devices and emultors)

The attached project is super easy and detailed, it the latest prerelease. If you downgrade it, it will work as expected. There are really no lightweight workarounds for this so please fix this asap :)
Comment 1 Rui Marinho 2017-01-24 22:43:09 UTC
Should be fixed in 2.3.4-pre2

Note You need to log in before you can comment on or make changes to this bug.