Skip to content

Conversation

@SimonDarksideJ
Copy link
Contributor

@SimonDarksideJ SimonDarksideJ commented Oct 26, 2018

Overview


@davidkline-ms noted an exception that was being raised in a UWP build on both Windows10 and HoloLens in #2979.

On investigation, this was actually caused by poorly serialised data in the DefaultMixedRealityConfigurationProfile asset. When the Core Services get reordered for Initialization, these serialised versions were also being detected and as they were being serialized by their concrete types and not their interface, the system failed to identify them as core systems.

This had two effects:

  • The core system were duplicated in the service registry, one as a concrete type and another as a system interface
  • The concrete type, being not seen as a core system, was attempted to be registered as a Registered service, causing a type cast failure.

It was also noted by others that there was some duplicated core system type checking, which needs cleaning up

Resolution


Several changes have been made to resolve and reduce the risk of this happening in the future

  • Serialisation of the Active Managers has been removed (we weren't using it anyway, the use case will need to be revalidated in the future)
  • The Default config asset has been cleaned up
  • The duplicate CoreSystemType check has been cleaned up
  • The RegisterService function now also returns whether the system was indeed added or if an error was caused through a Boolean
  • Use of the RegisterService call on initialisation now also listens for the Boolean result for extra protection
  • Waves have been parted and many life cycles of my dev PC have been used up trying to figure out why Unity is so bad at building dev builds (and C++ is a huge drain on my life, I missed two meetings fixing this)

Changes


Tested on


  • Via Unity debug
  • UWP Dev .NET build
  • AppX generated from UWP .NET build
  • IL2CPP build in VS
  • Appx generated from IL2CPP build

1: Cleared out invalid serialised "services" from the DefaultMixedRealityToolkitConfigurationProfile.asset
2: Removed serialization functions from the MixedRealityToolkitConfigurationProfile script

Continuing to address other comments noted in the issue, including the double use of "IsCoreSystem"
* Added success / fail return to RegisterService call
* Updated Internal use of RegisterService to capture success / Fail response
@SimonDarksideJ
Copy link
Contributor Author

incorporated the IsAssignableFrom fix from @StephenHodgson s other PR #2976

Copy link
Contributor

@StephenHodgson StephenHodgson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Just a few minor changes.

StephenHodgson
StephenHodgson previously approved these changes Oct 26, 2018
@SimonDarksideJ
Copy link
Contributor Author

That felt like a rapid fire round

@david-c-kline
Copy link

confirmed fixed 2979

@david-c-kline david-c-kline merged commit 5f397e5 into microsoft:mrtk_development Oct 26, 2018
@SimonDarksideJ SimonDarksideJ deleted the mrtk_development_SerializationFix branch November 13, 2018 10:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants