microsoft / GraphEngine

Microsoft Graph Engine
http://www.graphengine.io/
MIT License
2.19k stars 328 forks source link

Wrong Async RPC Method called [BUG] #308

Closed TaviTruman closed 4 years ago

TaviTruman commented 4 years ago

The wrong async method is being called! Very frustrating to encounter this type of bug at this stage in development. I have a medium-size complex WPF/MVVM project using Trinity/GraphEngine; I have integrated GraphEngine using a modular MVVM design pattern using PRISM and Castle Windsor DI. I have created a number of .NET472 assemblies that embody data segments using the Separation of Concerns design idiom.

image

I have created CommunicationShell, a wrapper around the Trinity APIs that set up the communications stack; the CommunicationShell is injected into each ViewModel - this is done so as to avoid duplicate code and to only have a single established environment for the entire application and all ViewModel instances.

image

In this code segment the Trinity client-side environment is established:

image

You can see that I'm using the module Trinity dynamic server composition API to register each communication module; I am also getting each module implementation setting up reactive observables against each module.

Here is the error:

image

In this existing codebase the RPC method "PushContactDataModelAsync" is never called but as you can see here it has been called by the Trinity runtime!

Here is the only actual RPC method called in the app at this time:

image

As you can see I make the call to "QueryUserAuthInfoAsync" - this is a bug.

I have a lot of material regarding this bug and I am willing to connect via LiveShare in VS 2019 so that it can be observed directly. Please let me know what other data and or information you need to move forward in investigating the problem.

yatli commented 4 years ago

Quick guess: stale assembly?

Do these methods have the same signature?

TaviTruman commented 4 years ago

Here is the signature of the two methods - I don't think they aren't the same:

ContactDataModel.zip UserAuthenticationProtols.zip

TaviTruman commented 4 years ago

@yatli I forgot to mention that the purposed RPC method (the right method), is called along with the wrong method being called; just to make it even more strange.

TaviTruman commented 4 years ago

I went looking through the Graph Engine source I could not find examples of where multiple modules are loaded into a single TrinityServer instance; so, I am going to leave this issue open for now - this is a bug. In FanoutSeach and DynamicCluster only a single module instance is ever used - it works and I have it working as well, so I'll follow the design examples I found in the aforementioned projects and just use one module; that makes the TSL files larger than I'd like them to be and I'll need to run more than one TrinityServer. I can message between TrinityServer instances to coordinate computations.

TaviTruman commented 4 years ago

After lots of testing and re-reading the available docs I now understand how the API works and why it works the way it does. I studied and traced through a lot of code via debugging; I'm working on some documentation to more clearly detail my findings. I was using the API incorrectly.