Once I executed ConsoleCommand to change Scalability setting then I can not save Scalability setting to config

In my case I want to make a quality setting panel there are some Scalability sliders and if player change the setting and saved it. I need to save the change to config for Persistence.

but when I execute some ConsoleCommand like

FString CM = TEXT("sg.TextureQuality ") + TextureQuality;
				Viewport->ConsoleCommand(CM);

I can not change and save the Scalability changes any more. the following code it is what am I do the set Scalability and save the value to config.

FString TextureQuality_CM = TEXT(“sg.TextureQuality”);

				IConsoleVariable* CVar = IConsoleManager::Get().FindConsoleVariable(*TextureQuality_CM);
				CVar->Set(FCString::Atoi(*TextureQuality) - 1);

			UserSettings->ScalabilityQuality.TextureQuality = FCString::Atoi(*TextureQuality);
		
			Scalability::SetQualityLevels(UserSettings->ScalabilityQuality);
			Scalability::SaveState(GGameUserSettingsIni);

IConsoleManager::Get().CallAllConsoleVariableSinks();

Hi ,

I am looking into another issue that is nearly identical to the one you described. It looks like some lines of source code may be out of order for all config settings to be saved correctly. I am waiting for some developers to get back after the holiday break to confirm this. A work around for now would be to call UGameUserSettings::SaveSettings() twice (scalability settings look like they are being set after the settings are actually saved, so the new scalability settings don’t make it into the saved settings). I will update you when I get some more information about what is happening here.

I am looking forward waiting for you answer. thank you

It looks like this error was caught and fixed just prior to the developers leaving for the holiday break. I was informed that we are trying to get the fix for this included in version 4.7.

Hello,

Just wanted to let you know that this issue is still present in 4.7.5 and the workaround sill works.

Hi ,

A fix for this issue was added for 4.8, then also merged into 4.7 (you can find the commit here if you are using source code). What is your test case where you are still seeing this issue occur?