Skip to content

Reproduce duplicate connections bug in Mock backend#118

Closed
google-labs-jules[bot] wants to merge 2 commits into
mainfrom
bugfix-fix-duplicate-connections-nm-11243255589086932806
Closed

Reproduce duplicate connections bug in Mock backend#118
google-labs-jules[bot] wants to merge 2 commits into
mainfrom
bugfix-fix-duplicate-connections-nm-11243255589086932806

Conversation

@google-labs-jules
Copy link
Copy Markdown
Contributor

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

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).
@google-labs-jules
Copy link
Copy Markdown
Contributor Author

👋 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 @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!


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.
Comment thread wifi/mock/mock.go
Comment on lines +121 to +129
// 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)
// }
// }
// }
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Can we keep the strength variability and still reproduce the bug correctly?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

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.

@shazow shazow closed this Dec 28, 2025
@shazow shazow deleted the bugfix-fix-duplicate-connections-nm-11243255589086932806 branch December 28, 2025 18:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant