We’ve spent quite a few hours on this problem and haven’t yet dug into it’s root cause but have fairly sufficient evidence of the issue.
Defining the Problem:
SyncOnModelCreated (Event) arrives inside ExternalSyncServiceEventHandler which is then placed on the command bus AddSiteFromESS (Command)
This command should be picked up by a @CommandHandler inside the SiteAggregate for the above command. Instead it arrives on an @EventHandler for completely different event SiteRegister (Event). The event SiteRegister contains valid data and the original command AddSiteFromESS is never handled in this case.
Reviewing the tracestack we can see that right up to the loading of the Aggregate AddSiteFromESS is in the variables window as the command we should handle.
By the time we get to executeWithResult it is now trying to iterate over an event for SiteRegistered (which should not have been triggered in any way).
The top of the tracestack has us inside the SiteAggregate for the handler of the SiteRegistered event which is where the breakpoint is set.
I would be happy to share more information from the tracestack as well as the variables but at the moment we are dumb founded. We’ve been able to reproduce this on multiple machines, with as much isolation of the problem as we could.