Skip to content

storage: avoid rendering wizard pages while Cockpit Storage is active #758

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 15, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/components/AnacondaPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ export const AnacondaPage = ({
isFirstScreen,
isFormDisabled,
setIsFormDisabled,
showStorage,
step,
title,
usePageInit,
Expand All @@ -53,7 +54,9 @@ export const AnacondaPage = ({
}
}, [isFormDisabled]);

if (!showPage) {
// Don't try to render anything while cockpit storage mode is active
// as background API calls might cause UnknownDeviceError
if (!showPage || showStorage) {
return null;
}

Expand Down
2 changes: 1 addition & 1 deletion src/components/AnacondaWizard.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ export const AnacondaWizard = ({ currentStepId, dispatch, isFetching, onCritFail
onCritFail,
setIsFormDisabled,
setIsFormValid,
showStorage,
};

const stepsOrder = getSteps(userInterfaceConfig, isBootIso, storageScenarioId);
Expand Down Expand Up @@ -87,6 +86,7 @@ export const AnacondaWizard = ({ currentStepId, dispatch, isFetching, onCritFail
step={s.id}
title={s.title}
isFirstScreen={s.isFirstScreen}
showStorage={showStorage}
usePageInit={s.usePageInit}>
<s.component {...componentProps} isFirstScreen={s.isFirstScreen} />
</AnacondaPage>
Expand Down
2 changes: 0 additions & 2 deletions src/components/storage/InstallationMethod.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ const InstallationMethod = ({
setIsFormDisabled,
setIsFormValid,
setStepNotification,
showStorage,
}) => {
const [isReclaimSpaceCheckboxChecked, setIsReclaimSpaceCheckboxChecked] = useState();

Expand Down Expand Up @@ -95,7 +94,6 @@ const InstallationMethod = ({
isFormDisabled={isFormDisabled}
onCritFail={onCritFail}
setIsFormValid={setIsFormValid}
showStorage={showStorage}
/>
</DialogsContext.Provider>
</Form>
Expand Down
10 changes: 1 addition & 9 deletions src/components/storage/InstallationScenario.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ const InstallationScenarioSelector = ({
idPrefix,
isFormDisabled,
setIsFormValid,
showStorage,
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

question (bug_risk): Removed showStorage guard; ensure side effects are controlled

Without showStorage’s guard, ensure useEffect dispatches don’t fire unexpectedly when cockpit storage mode toggles.

}) => {
const { appliedPartitioning, diskSelection, partitioning } = useContext(StorageContext);
const { devices, mountPoints } = useOriginalDeviceTree();
Expand Down Expand Up @@ -131,11 +130,6 @@ const InstallationScenarioSelector = ({
useEffect(() => {
let selectedScenarioId = "";

// Don't mess up with the scenarios while cockpit storage mode is active
if (showStorage) {
return;
}

if (storageScenarioId && scenarioAvailability[storageScenarioId].available === undefined) {
return;
}
Expand All @@ -160,7 +154,7 @@ const InstallationScenarioSelector = ({
dispatch(setStorageScenarioAction(selectedScenarioId));
}
setIsFormValid(!!selectedScenarioId);
}, [dispatch, mountPoints, scenarioAvailability, setIsFormValid, showStorage, storageScenarioId]);
}, [dispatch, mountPoints, scenarioAvailability, setIsFormValid, storageScenarioId]);

const onScenarioToggled = (scenarioId) => {
dispatch(setStorageScenarioAction(scenarioId));
Expand Down Expand Up @@ -200,7 +194,6 @@ export const InstallationScenario = ({
isFirstScreen,
isFormDisabled,
setIsFormValid,
showStorage,
}) => {
const headingLevel = isFirstScreen ? "h3" : "h2";
const { diskSelection, storageScenarioId } = useContext(StorageContext);
Expand Down Expand Up @@ -231,7 +224,6 @@ export const InstallationScenario = ({
idPrefix={idPrefix}
isFormDisabled={isFormDisabled}
setIsFormValid={setIsFormValid}
showStorage={showStorage}
/>
</FormGroup>
</FormSection>
Expand Down
Loading