Skip to content

Commit b3fc9fe

Browse files
committed
fix(update): keep modern deferral metadata current
1 parent 394037c commit b3fc9fe

2 files changed

Lines changed: 6 additions & 3 deletions

File tree

src/commands/doctor/shared/update-phase.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ describe("update-phase env helpers", () => {
102102
[UPDATE_DEFER_CONFIGURED_PLUGIN_INSTALL_REPAIR_ENV]: "1",
103103
[UPDATE_PARENT_SUPPORTS_DOCTOR_CONFIG_WRITE_ENV]: "1",
104104
}),
105-
).toBe(true);
105+
).toBe(false);
106106
expect(
107107
isLegacyParentWritableUpdateDoctorPass({
108108
[UPDATE_POST_CORE_CONVERGENCE_ENV]: "1",

src/commands/doctor/shared/update-phase.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,15 @@ export function shouldDeferConfiguredPluginInstallRepair(env: NodeJS.ProcessEnv)
5555
/**
5656
* True iff a new doctor is running inside a shipped parent that can persist
5757
* doctor config repairs. Config writes must stay old-parent-readable because
58-
* that parent resumes after the candidate doctor exits.
58+
* that parent resumes after the candidate doctor exits. Modern parents also
59+
* set the explicit deferral marker, so they should keep current metadata
60+
* writes while still deferring payload repair.
5961
*/
6062
export function isLegacyParentWritableUpdateDoctorPass(env: NodeJS.ProcessEnv): boolean {
6163
return (
6264
isUpdatePackageSwapInProgress(env) &&
63-
isTruthyEnvValue(env[UPDATE_PARENT_SUPPORTS_DOCTOR_CONFIG_WRITE_ENV])
65+
isTruthyEnvValue(env[UPDATE_PARENT_SUPPORTS_DOCTOR_CONFIG_WRITE_ENV]) &&
66+
!isTruthyEnvValue(env[UPDATE_DEFER_CONFIGURED_PLUGIN_INSTALL_REPAIR_ENV])
6467
);
6568
}
6669

0 commit comments

Comments
 (0)