Fix synchronisation setting compatibility recovery

This commit is contained in:
vorotamoroz committed 2026-09-08 17:16:01 +00:00
1 parent a5056ab157
commit 78c2ccc15a
15 files changed
+1073 -237

No files matched your search

+22
View File
@@ -19,9 +19,11 @@ import {
flagHandlerToEventHandler,
} from "./redFlag";
import {
DEFAULT_SETTINGS,
TweakValuesRecommendedTemplate,
TweakValuesShouldMatchedTemplate,
TweakValuesTemplate,
type TweakValues,
} from "@vrtmrz/livesync-commonlib/compat/common/types";
import {
ExtraOnLocal,
@@ -1149,6 +1151,26 @@ describe("Red Flag Feature", () => {
});
describe("Remote configuration adjustment", () => {
it("compatibility: preserves the local filename-case value when the remote omits it", async () => {
const host = createHostMock();
const config = {
...DEFAULT_SETTINGS,
...TweakValuesShouldMatchedTemplate,
handleFilenameCaseSensitive: false,
};
const remote: TweakValues = { ...TweakValuesShouldMatchedTemplate };
delete remote.handleFilenameCaseSensitive;
host.mocks.tweakValue.fetchRemotePreferred.mockResolvedValueOnce(availableRemoteTweaks(remote));
await adjustSettingToRemote(host as any, createLoggerMock(), config);
expect(host.mocks.ui.confirm.askSelectStringDialogue).not.toHaveBeenCalled();
expect(host.mocks.setting.applyExternalSettings).toHaveBeenCalledWith(
expect.objectContaining({ handleFilenameCaseSensitive: false }),
true
);
});
it("keeps this device's E2EE settings when preparing to overwrite the remote", async () => {
const host = createHostMock();
Object.assign(host.mocks.setting.settings, TweakValuesShouldMatchedTemplate, {