fix: [M3-7877] - Incorrect Linode network interface configuration being displayed#10690
Conversation
| return handleChange({ | ||
| ipam_address: ipamAddress, | ||
| label, | ||
| purpose, | ||
| }); |
There was a problem hiding this comment.
This is the actual fix.
There was a problem hiding this comment.
@hana-linode can you verify this change has no unintended consequences? I wasn't able to figure out the original purpose of this.
There was a problem hiding this comment.
@hkhalil-akamai It's been a while so I don't really remember, but I think the original purpose was to return early if the purpose wasn't vpc so that vpc properties would not be passed to the handleChange function
| const renderResult = render(wrapWithTheme(ui, options)); | ||
| return { | ||
| ...renderResult, | ||
| rerender: (ui) => renderResult.rerender(wrapWithTheme(ui, options)), |
There was a problem hiding this comment.
Adding support for the rerender method
| it('should display the correct network interfaces', async () => { | ||
| const props = { | ||
| isReadOnly: false, | ||
| linodeId: 0, | ||
| onClose: vi.fn(), | ||
| }; | ||
|
|
||
| const { findByText, rerender } = renderWithTheme( | ||
| <LinodeConfigDialog config={undefined} open={false} {...props} /> | ||
| ); | ||
|
|
||
| rerender( | ||
| <LinodeConfigDialog | ||
| config={linodeConfigFactory.build({ | ||
| interfaces: [vpcInterface, publicInterface], | ||
| })} | ||
| open | ||
| {...props} | ||
| /> | ||
| ); | ||
|
|
||
| await findByText('VPC'); | ||
| await findByText('Public Internet'); | ||
| }); |
There was a problem hiding this comment.
In theory, this test should replicate the exact sequence causing the bug. However, I haven't been able to fail this test without the fix, which I believe is due to inconsistencies between how Automatic Batching works in tests vs in the browser.
I'm still keeping this test because it may catch regressions in the future.
|
Coverage Report: ✅ |
bnussman-akamai
left a comment
There was a problem hiding this comment.
After making no changes, clicking "Save Changes", and refreshing, the config's VPC looked different than how it was originally configured. The after refreshing again, it went back to the expected values.
Not sure if this is related. I haven't been able to easily reproduce.
Screen.Recording.2024-07-22.at.9.58.27.AM.mov
I have been unable to reproduce this. There is a lot of complicated logic in the |
bnussman-akamai
left a comment
There was a problem hiding this comment.
I wasn't able to reproduce the issue I showed above, so I think we're good
|
I was able to reproduce the bug @bnussman-akamai saw on this branch on a fresh Linode and new VPC created during the flow. I was not able to reproduce in prod 🤔 |
dwiley-akamai
left a comment
There was a problem hiding this comment.
Code review ✅
Observing correct network interfaces ✅
I was not able to reproduce the issue Banks observed, and I didn't observe any adverse impacts from the changes in InterfaceSelect.tsx
|
@bnussman-akamai @hana-linode @dwiley-akamai I was able to trace back the issue to the same The following steps seem to reliably reproduce the issue (before the fix):
|
|
So it seems like editing the config doesn't update the UI now 💀 . See the checkbox still being checked on this branch vs unchecked on prod Screen.Recording.2024-07-23.at.3.06.47.PM.mov |
|
I haven't been able to replicate the first bug I brought up, which is good ✅ I am seeing the form reset to a weird state when I try to remove a VPC IP range, which does not happen in production. Screen.Recording.2024-07-23.at.3.08.54.PM.mov |
bnussman-akamai
left a comment
There was a problem hiding this comment.
No more bugs found from my testing 🎉
hana-akamai
left a comment
There was a problem hiding this comment.
No more bugs found as well 🎉

Description 📝
Fixes a bug in the Linode configuration dialog causing network interfaces to be displayed incorrectly.
Changes 🔄
LinodeKernelFactoryto mock kernelsBug pathology 🪳
The following represents my best explanation of the bug but may not be correct:
The bug is caused by a race condition between two
useEffects:Updates the formik form state when config values become available
manager/packages/manager/src/features/Linodes/LinodesDetail/LinodeConfigs/LinodeConfigDialog.tsx
Lines 467 to 531 in e60faef
Modifies VPC interfaces to add IPv4 information
manager/packages/manager/src/features/Linodes/LinodesDetail/LinodeSettings/InterfaceSelect.tsx
Lines 230 to 282 in e60faef
The race condition occurs in the following sequence:
LinodeConfigDialogis openedconfigis updated fromundefinedto the selected Linode's config -> this sets offuseEffect1 which queues the new interface values in formikInterfaceSelectis mounted -> this sets offuseEffect2, overriding the updates from step 2The fix:
Update
useEffect2 to return early if the interface is non-VPCTarget release date 🗓️
7/22
Preview 📷
Screen.Recording.2024-07-17.at.2.18.13.PM.mov
Screen.Recording.2024-07-17.at.2.18.36.PM.mov
How to test 🧪
Prerequisites
eth0: VPCeth1: Public internetReproduction steps
This bug is caused by a race condition and is tricky to reproduce consistently. The following steps seem to trigger the bug reliably:
Verification steps
As an Author I have considered 🤔
Check all that apply