uSync multiple sets not working correctly in v16?

Before creating an issue in the uSync tracker, let me check here if I’m missing anything here. To me, it seems that working with multiple sets in uSync doesn’t work in uSync 16(.0.2).

I have this appSettings.json:

  "uSync": {
    "Settings": {
      "RootFolder": "uSync/",
      "DefaultSet": "Default",
      "ImportAtStartup": "Settings",
      "ExportOnSave": "None",
      "UiEnabledGroups": "Settings",
      "AddOnPing": false
    },
    "Sets": {
      "Default": {
        "HandlerGroups": [
          "ContentTypeHandler",
          "DataTypeHandler",
          "LanguageHandler",
          "MacroHandler",
          "MediaTypeHandler",
          "TemplateHandler",
          "DictionaryHandler",
          "ContentTemplateHandler"
        ],
        "DisabledHandlers": [
          "ContentHandler",
          "DomainHandler",
          "MediaHandler",
          "RelationTypeHandler"
        ]
      }
    }
  }

These settings are fine and act as the default starting point of the environment-specific uSync settings. For development, I want a much different behaviour than test, acceptance and production, so I created another set just to be sure. So this is the appSettings.Development.json:

  "uSync": {
    "Settings": {
      "DefaultSet": "Development",
      "ImportAtStartup": "All",
      "UiEnabledGroups": "All",
      "ExportOnSave": "All",
      "ReportDebug": true,
      "EnableHistory": false
    },
    "Sets": {
      "Development": {
        "Enabled": true,
        "HandlerGroups": [ "ContentHandler", "DomainHandler", "MediaHandler", "RelationTypeHandler", "ContentTypeHandler", "DataTypeHandler", "LanguageHandler", "MacroHandler", "MediaTypeHandler", "TemplateHandler", "DictionaryHandler", "ContentTemplateHandler" ],
        "DisabledHandlers": [],
        "HandlerDefaults": {
          "FailOnMissingParent": true
        }
      },
      "Default": {
        "Enabled": false
      }
    }
  }

So effectively, I disabled the default set and added a development set. As you can see, this set enables all handlergroups and has no disabled handler. In the past this worked fine. However, in the backoffice, it will always show ‘default’ as set and have the 4 handlers disabled as specified in the appSettings.config:

Just to make sure that the appSettings.json and appSettings.development.json weren’t interfering, I created a single configuration for uSync with to sets, where I default to the ‘development’ set instead of the ‘default’ set:

  "uSync": {
    "Settings": {
      "RootFolder": "uSync/",
      "DefaultSet": "Development",
      "ImportAtStartup": "Settings",
      "ExportOnSave": "None",
      "UiEnabledGroups": "All",
    },
    "Sets": {
      "Default": {
        "HandlerGroups": [
          "ContentTypeHandler",
          "DataTypeHandler",
          "LanguageHandler",
          "MacroHandler",
          "MediaTypeHandler",
          "TemplateHandler",
          "DictionaryHandler",
          "ContentTemplateHandler"
        ],
        "DisabledHandlers": [
          "ContentHandler",
          "DomainHandler",
          "MediaHandler",
          "RelationTypeHandler"
        ]
      },
      "Development": {
        "Enabled": true,
        "HandlerGroups": [
          "ContentHandler",
          "DomainHandler",
          "MediaHandler",
          "RelationTypeHandler",
          "ContentTypeHandler",
          "DataTypeHandler",
          "LanguageHandler",
          "MacroHandler",
          "MediaTypeHandler",
          "TemplateHandler",
          "DictionaryHandler",
          "ContentTemplateHandler"
        ],
        "DisabledHandlers": [],
        "HandlerDefaults": {
          "FailOnMissingParent": true
        }
      }
    }
  }

As far as I know, this should at least give you the option in the backoffice to select the set to use AND the development set should be the default. But once again, I only see the default set in the backoffice with the 4 disabled handlers and I don’t see any option for selecting a different set:

Even if I disable the default set, it will still only show the default set.

Seems to me it’s a bug, but uSync config in appSettings can be a bit tricky, so I wanted to check if I’m missing something here.

Hi,

Yeah so we haven’t implemented the UI for selectable sets on v16 (yet?) because basically we didn’t think anyone was using it (I have never actually ever spoken to anyone who did / knew it existed!).

Looking at where we are, programmatically they do work (with a bit of extra code - see below), but the UI is currently always reporting the default set settngs back to you.

I would say you can achieve this by overriding the default set settings in your development appsettings. - but i can see you might want them different.

So inorder to get extra sets to load you need to add a bit of code that loads the new config on startup

Selectable Sets | Jumoo docs

this is a dotnet core thing because the new set is a named config section so we have to tell it to load. for you the code might look like this :

public class ExtraSetComposer : IComposer
{
    public void Compose(IUmbracoBuilder builder)
    {
        // load the config for our Development set
        builder.Services.Configure<uSyncHandlerSetSettings>(
            "ContentOnly",
            builder.Config.GetSection(Configuration.uSyncSetsConfigPrefix + "Development"));
    }
}

this will load the set and the setting you have will be used in the backend,

but at the moment (and i will fix this!) it won’t show that as loaded in the backend, so not sure it’s realy the ideal.

Ah good to know. Maybe you can add a disclaimer to the documentation. I only used a different set because I wanted to make sure that if the ‘default’ set would change that it wouldn’t change the development usync setting. But it’s no big deal for me to use the default set and override the values for development.

I assume this is not very high in your priority list?

Yeah the docs, already say it’s not implemented on v16 :wink:

I’m taking a look just now, i think we can implement it fairly quickly.

Fair, I just looked at the settings page and because of that I assumed that it would work because all the settings are still there:

Merged in and ready for the next release :

and a nightly build if you need it now now.

https://dev.azure.com/jumoo/Public/\_artifacts/feed/nightly/NuGet/uSync/overview/16.0.3-build.20250805.1

1 Like