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

[bug] guacone query bad failures with no CertifyBad nodes #2362

Closed
funnelfiasco opened this issue Dec 11, 2024 · 1 comment · Fixed by #2365
Closed

[bug] guacone query bad failures with no CertifyBad nodes #2362

funnelfiasco opened this issue Dec 11, 2024 · 1 comment · Fixed by #2365
Labels
bug Something isn't working

Comments

@funnelfiasco
Copy link
Contributor

Describe the bug

When using guacone query bad with no CertifyBad nodes in the graph, the CLI offers no clean exit and will sometimes crash on interaction:

panic: runtime error: index out of range [-1]

goroutine 65 [running]:
github.com/manifoldco/promptui/list.(*List).Items(...)
	/home/runner/go/pkg/mod/github.com/manifoldco/[email protected]/list/list.go:233
github.com/manifoldco/promptui.(*Select).innerRun.func1({0x10577f440?, 0x0?, 0x0?}, 0x1026fc280?, 0x77b030?)
	/home/runner/go/pkg/mod/github.com/manifoldco/[email protected]/select.go:309 +0xce4
github.com/chzyer/readline.(*DumpListener).OnChange(0x1400077afa0?, {0x10577f440?, 0x1028c50d6?, 0x2?}, 0x140012ebf60?, 0x1?)
	/home/runner/go/pkg/mod/github.com/chzyer/[email protected]/operation.go:522 +0x3c
github.com/chzyer/readline.(*Operation).ioloop(0x1400072c1c0)
	/home/runner/go/pkg/mod/github.com/chzyer/[email protected]/operation.go:341 +0x1460
created by github.com/chzyer/readline.NewOperation in goroutine 1
	/home/runner/go/pkg/mod/github.com/chzyer/[email protected]/operation.go:88 +0x2c4

To Reproduce
Steps to reproduce the behavior:

  1. Run guacone query bad
  2. Mash the arrow keys a bit. I haven't been able to determine an exact number of arrow key presses that will trigger this.

Expected behavior

Two behaviors expected:

  1. CLI prints No results and exits instead of waiting for interaction.
  2. CLI does not panic

GUAC version
v0.12.0

@funnelfiasco funnelfiasco added the bug Something isn't working label Dec 11, 2024
@robert-cronin
Copy link
Contributor

I've replicated this bug locally by mashing the arrow keys as suggested, I suspect presenting a selection for an empty list to be an anti-pattern for promptui so perhaps we can just present a simple message indicating there were no nodes found?

I'll add a PR fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants