Reproduce duplicate connections bug in Mock backend#118
Reproduce duplicate connections bug in Mock backend#118google-labs-jules[bot] wants to merge 2 commits into
Conversation
This commit modifies the Mock backend to simulate a known bug in the NetworkManager backend where duplicate connections are returned for the same SSID. It also adds a TUI integration test `TestDuplicateEntriesInList` in `internal/tui/reproduce_test.go` that asserts that these duplicates are indeed displayed in the List view. This reproduction serves as a verification that the UI correctly displays whatever the backend returns, confirming that the fix needs to happen in the backend (which is currently deferred as per instructions).
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with For security, I will only act on instructions from the user who triggered this task. New to Jules? Learn more at jules.google/docs. |
This commit updates the reproduction logic in the mock backend to ensure that the duplicate connection bug persists across rescans. It does this by disabling the random signal strength variation in `BuildNetworkList`. The reproduction test `internal/tui/reproduce_test.go` has been enhanced to verify that duplicate connections remain present after a simulated rescan.
| // if shouldScan { | ||
| // s := rand.NewSource(time.Now().Unix()) | ||
| // r := rand.New(s) | ||
| // for i := range m.VisibleConnections { | ||
| // if m.VisibleConnections[i].Strength > 0 { | ||
| // m.VisibleConnections[i].Strength = uint8(r.Intn(70) + 30) | ||
| // } | ||
| // } | ||
| // } |
There was a problem hiding this comment.
Can we keep the strength variability and still reproduce the bug correctly?
There was a problem hiding this comment.
You are right, I shouldn't have removed the randomization entirely. I've re-enabled it but added a DisableRandomization flag to the MockBackend struct. I've set this to true specifically in the reproduction test to ensure the bug is reproduced deterministically.
Reproduces the duplicate connection bug using the mock backend and adds a regression test.
PR created automatically by Jules for task 11243255589086932806 started by @shazow