GeezerVison is showing github.com — fix(web): project reset skips environments that cannot store the over… · flamboh/t3code@7ccf473
File treeExpand file treeCollapse file tree Open diff view settings apps/web/src/components/settings
Expand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: apps/web/src/components/settings/scopedSettings.test.ts +4Lines changed: 4 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -935,13 +935,17 @@ describe("environments that cannot store a setting", () => { | 935 | 935 | environmentWideWrites: planScopedSettingsPatch(all, afterFirstSave, { | 936 | 936 | defaultAutoPull: false, | 937 | 937 | }).serverWrites.map(({ label }) => label), | | 938 | + projectReset: planScopedSettingsClear(project, afterFirstSave, [ | | 939 | + "defaultAutoPull", | | 940 | + ]).serverWrites.map(({ label }) => label), | 938 | 941 | }).toEqual({ | 939 | 942 | failed: ["Server"], | 940 | 943 | projectSecondClick: ["Laptop"], | 941 | 944 | projectMixed: false, | 942 | 945 | serverCheckout: "Update T3 Code on Server to use this setting.", | 943 | 946 | environmentWideMixed: true, | 944 | 947 | environmentWideWrites: ["Laptop", "Server"], | | 948 | + projectReset: ["Laptop"], | 945 | 949 | }); | 946 | 950 | }); | 947 | 951 | }); |
Collapse file Copy file name to clipboardExpand all lines: apps/web/src/components/settings/scopedSettings.ts +6-3Lines changed: 6 additions & 3 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -459,9 +459,12 @@ export function planScopedSettingsClear( | 459 | 459 | ) { | 460 | 460 | const serverWrites = | 461 | 461 | scope.kind === "project" || scope.kind === "checkout" | 462 | | - ? projectOverrideWrites(scope, environments, (_current, settings, projectId) => | 463 | | - clearProjectSettingsOverrides(settings, projectId, keys), | 464 | | - ) | | 462 | + ? projectOverrideWrites(scope, environments, (_current, settings, projectId, environment) => { | | 463 | + const unsupported = resolveUnsupportedSettingKeys(environment, true); | | 464 | + return keys.every((key) => unsupported.has(key)) | | 465 | + ? undefined | | 466 | + : clearProjectSettingsOverrides(settings, projectId, keys); | | 467 | + }) | 465 | 468 | : []; | 466 | 469 | return { | 467 | 470 | clientPatch: {} as ClientSettingsPatch, | |
|