-
Notifications
You must be signed in to change notification settings - Fork 370
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] - Volume Create Drawer Crash (Linode detail) #10225
Conversation
packages/manager/src/features/Volumes/VolumeDrawer/ConfigSelect.tsx
Outdated
Show resolved
Hide resolved
Coverage Report: ✅ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @abailly-akamai for fixing this issue. Confirming that "Create Volume" (Linode detail) is working as expected.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice find & fix. Verified the testing steps.
@@ -10,6 +10,7 @@ import { TagsInput } from 'src/components/TagsInput/TagsInput'; | |||
import { TextField } from 'src/components/TextField'; | |||
import { Typography } from 'src/components/Typography'; | |||
import { MAX_VOLUME_SIZE } from 'src/constants'; | |||
import { useFormValidateOnChange } from 'src/hooks/useFormValidateOnChange'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Out of scope of this PR, but this hook seems unnecessary as opposed to useState
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's true. I've thought about this hook, maybe not worth the abstraction, but also thought about how it kindly improves form nomenclature consistency across formik forms as opposed to declaring a randomly named piece of state each time.
…inode#10225)" This reverts commit 632b454.
Description 📝
This PR fixes a bad bug crashing the application when attempting to create a volume from the linode detail (storage tab).
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 but the fix here is tovalidateOnChange
only when the form has been submitted, not whensetFieldValue
is being called, since the useEffect is actually doing the right thing (esp for theVolumeCreate
).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 🔄
defaultValue
Preview 📷
How to test 🧪
Reproduction steps
Verification steps
Also
As an Author I have considered 🤔
Check all that apply