Skip to content

fix: screen_inspector.go ensureInspectorWorkflows() refreshes unconditionally — isEmpty guard is dead code #209

@nathanhuh

Description

@nathanhuh

Summary

`ensureInspectorWorkflows()` in `internal/app/screen_inspector.go` checks whether workflows are empty but then calls `refreshInspectorWorkflows()` unconditionally regardless of the result, making the isEmpty check meaningless. This likely causes unnecessary re-fetches on every call.

Details

  • Current logic: check if empty → call refresh anyway
  • The isEmpty guard was presumably intended to short-circuit the refresh when workflows are already loaded
  • As written, the guard is dead code and the function always refreshes

Checklist

  • Restructure to: `if len(m.inspectorWorkflows) == 0 { m.refreshInspectorWorkflows() }`
  • Remove the unconditional refresh call
  • Verify the inspector screen still loads workflows correctly on first visit
  • Verify workflows are not re-fetched on subsequent visits to the inspector screen

References

  • `internal/app/screen_inspector.go:53-59`

Raised from senior code review (2026-05-12).

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions