Distributed signals and new tenants

Topics: Administration, Core
Feb 7, 2015 at 10:58 AM
Edited Feb 7, 2015 at 11:00 AM
I noticed that the DistributedShellStarter has a todo comment about it not working for new tenants. I started to have a look and to be honest I struggled to figure out how this would work.

In the Subscribe Action delegate there is...
using (var scope = _workContextAccessor.CreateWorkContextScope()) {
                    var shellSettings = scope.Resolve<ShellSettings>(); // this is always the Default tenant
                    if (shellSettings != null)
                        // todo: this doesn't work as the new tenants list is lost right after
                        var shellSettingsManagerEventHandler = scope.Resolve<IShellSettingsManagerEventHandler>();

                        var orchardHost = scope.Resolve<IOrchardHost>() as DefaultOrchardHost;
                        if (orchardHost != null)
                            var startUpdatedShellsMethod = typeof(DefaultOrchardHost).GetMethod("StartUpdatedShells", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance);
                            startUpdatedShellsMethod.Invoke(orchardHost, null);
  1. Should the scope be the work context of the tenant or is it right that this is the Default? It does make sense that the default or "host" would manage new tenants.
  2. When calling Saved should the shell settings be that of the tenant? Currently this is Default's shell settings as far as I can tell.
  3. Does anyone have any insight on how to test this locally?
Feb 9, 2015 at 6:28 PM
Does anyone have any ideas on what this should do?