Skip to content
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

fix: [M3-7804] - LinodeVolumeCreateForm crash (for real this time) #10235

Merged
merged 3 commits into from
Feb 28, 2024

Conversation

abailly-akamai
Copy link
Contributor

@abailly-akamai abailly-akamai commented Feb 28, 2024

Description 📝

This PR fixes a bad bug crashing the application when attempting to create a volume from the linode detail (storage tab).

follow up to #10225 which did not fix it completely

The useEffect in question was attempting to select a default value for the config select component and set the value for the field, creating an infinite loop with the label validation of the formik form (expecting a non-falsy value).

It is a bit a of weird bug, which did not surface before the react 18 update and the way useEffect was optimized. I can't say I fully understand the clash between our formik initial values, setFieldValue and our validation patterns. The fix here is to avoid the useEffect all together

Due to another interesting fact, the e2e test was not breaking as a result, perhaps due to the click methods timing differences between a user click and a CY.click().

Changes 🔄

Preview 📷

cloud linode com_linodes_50934298_storage

How to test 🧪

Reproduction steps

Verification steps

  • Navigate to http://localhost:3000/linodes/{linode id}/storage
  • Ensure only one config is present on the instance
  • Click on "Create Volume"
  • Notice the config selected in the config select
  • Create the volume, confirm payload and succession
  • Add a new config to the linode instance
  • Click on "Create Volume"
  • Notice the config select does not have a default value
  • Select a config
  • Create the volume, confirm payload and succession

Also

  • Verify that the volume create form is working properly with this update

As an Author I have considered 🤔

Check all that apply

  • 👀 Doing a self review
  • ❔ Our contribution guidelines
  • 🤏 Splitting feature into small PRs
  • ➕ Adding a changeset
  • 🧪 Providing/Improving test coverage
  • 🔐 Removing all sensitive information from the code and PR description
  • 🚩 Using a feature flag to protect the release
  • 👣 Providing comprehensive reproduction steps
  • 📑 Providing or updating our documentation
  • 🕛 Scheduling a pair reviewing session
  • 📱 Providing mobile support
  • ♿ Providing accessibility support

@abailly-akamai abailly-akamai self-assigned this Feb 28, 2024
@abailly-akamai abailly-akamai added the Bug Fixes for regressions or bugs label Feb 28, 2024
@abailly-akamai abailly-akamai marked this pull request as ready for review February 28, 2024 15:50
@abailly-akamai abailly-akamai requested a review from a team as a code owner February 28, 2024 15:50
@abailly-akamai abailly-akamai requested review from bnussman-akamai and hana-akamai and removed request for a team February 28, 2024 15:50
@@ -176,6 +167,7 @@ export const LinodeVolumeCreateForm = (props: Props) => {
<ConfigSelect
disabled={disabled}
error={touched.config_id ? errors.config_id : undefined}
key={linode.id}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this is the only change to this file - the rest of the diff was reverting the previous fix (not of it in production)

Copy link

Coverage Report:
Base Coverage: 81.34%
Current Coverage: 81.34%

@mjac0bs mjac0bs changed the title bug: [M3-7804] - LinodeVolumeCreateForm crash (for real this time) fix: [M3-7804] - LinodeVolumeCreateForm crash (for real this time) Feb 28, 2024
Copy link
Contributor

@hana-akamai hana-akamai left a comment

Choose a reason for hiding this comment

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

Confirmed no more crash in the Linode Create Volume Drawer and that /volumes/create still works

@hana-akamai hana-akamai added the Approved Multiple approvals and ready to merge! label Feb 28, 2024
@abailly-akamai abailly-akamai merged commit a482b21 into linode:develop Feb 28, 2024
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Approved Multiple approvals and ready to merge! Bug Fixes for regressions or bugs 🚨 Urgent
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants