port: Settings scope: support backward compat setting scope, remove ComponentRegistration in DialogStateManager (#5397)
The changes in Settings scope: support backward compat setting scope, remove ComponentRegistration in DialogStateManager (#5397) may need to be ported to maintain parity with microsoft/botbuilder-dotnet.
SettingsScope was not working in a backward compatible way because of 3 subtle things happening simultaneously:
DialogStateManagerwas registering theDialogcomponentRegistrationby itself- We removed
IConfigurationfrom the turnState, so legacySettingsMemoryScopedid not have access to configuration in turn state (so the registration in dialog state manager was not getting any settings)SettingsMemoryScopeonly gets evaluated onceHere we remove the
DialogStateManagercall toDialogComponentRegistrationsince this is the last call toComponentRegistrationin non-test code. Legacy code will still work because legacy adapters still addIConfigurationto the turnState. New code will use the new route.Also, fixing a breaking change where we would break folks using the default constructor of
SettingsMemoryScope.Note that tests still rely on
ComponentRegistrationand we have an R14 change to remove these, basically by moving theTestAdapterandTestScriptto theBotComponentpattern. This work is tracked here: https://github.com/microsoft/botbuilder-dotnet/issues/5396
Please review and, if necessary, port the changes.