Skip to content

[BUG] UserCondition / nil pointer in TUI #3029

@idefixcert

Description

@idefixcert

I have a question regarding UserCondition,
Lets assume I have a condition on one of the tasks:

hatchet.WithWaitFor(hatchet.UserEventCondition("process:next", "true")),

That allows me to pause a workflow until a user confirms.
I tried to find in the client sdk a possibility to see why a workflow is still running, but I am not able to find an answer on that.

Describe the issue
On tui if I click in the DAG on the TASK that has the WaitFor condition, I get a nil pointer.

Caught panic:

runtime error: invalid memory address or nil pointer dereference

Restoring terminal...

goroutine 1 [running]:
runtime/debug.Stack()
	/opt/hostedtoolcache/go/1.25.6/x64/src/runtime/debug/stack.go:26 +0x64
runtime/debug.PrintStack()
	/opt/hostedtoolcache/go/1.25.6/x64/src/runtime/debug/stack.go:18 +0x1c
github.com/charmbracelet/bubbletea.(*Program).recoverFromPanic(0x14000000f00, {0x101797bc0, 0x1022c2d70})
	/home/runner/go/pkg/mod/github.com/charmbracelet/bubbletea@v1.3.10/tea.go:847 +0x90
github.com/charmbracelet/bubbletea.(*Program).Run.func2()
	/home/runner/go/pkg/mod/github.com/charmbracelet/bubbletea@v1.3.10/tea.go:638 +0xc4
panic({0x101797bc0?, 0x1022c2d70?})
	/opt/hostedtoolcache/go/1.25.6/x64/src/runtime/panic.go:783 +0x120
github.com/hatchet-dev/hatchet/cmd/hatchet-cli/cli.tuiModel.Update({{0x10197dd68, 0x140001385b0}, {0x14000436440, 0x2, 0x2}, {0x14000407da0, 0x1, 0x1}, {{0x10198b920, 0x1400001b380}, ...}, ...}, ...)
	/home/runner/work/hatchet/hatchet/cmd/hatchet-cli/cli/tui.go:347 +0x1370

Environment

  • SDK: go (tui) latest version
  • Engine: Self-hosted v0.74.14

Expected behavior
What did you expect to happen instead?

I think my question is how is it possible to write a ui that allows to send user events to approve certain workflow steps

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions