-
Task
-
Resolution: Done
-
Normal
-
None
-
None
-
8
-
False
-
-
False
-
Testable
-
-
The current logic in src/components/storage/CockpitStorageIntegration.jsx for handling storage operations before returning to installation is fragile and overly complex. These operations include:
- Re-scanning devices
- Unlocking LUKS devices
- Resetting selected disks with MD arrays
- Creating partitioning if mount points are present
Currently, these steps are executed inside multiple useEffect hooks, guarded by a checkStep variable. However, there is no strict mechanism to ensure each step runs only once, making the approach unreliable. Additionally, the component code has grown excessively large, exceeding what a React component should manage.
Goal:
- Refactor the logic to ensure steps are executed exactly once when needed.
- Improve maintainability by moving storage-related logic out of the React component.
- Make execution flow more predictable and avoid unnecessary re-renders.
Acceptance Criteria:
- Each step runs only once when required.
- The logic is moved to a separate module or custom hook.
- The React component remains responsible only for rendering and state management.