steampipe icon indicating copy to clipboard operation
steampipe copied to clipboard

rationalise the use of status/progress hooks

Open kaidaguerre opened this issue 2 years ago • 0 comments

We currently have the following context 'hooks'

  • StatusHooks, which is used to display the spinner during interactive query execution
  • SnapshotProgress used to display snapshot generation progress messages
  • MessageRenderer used to add messages and warning to the InitData during query init (for failed prepared statements and FDW updates)
  • Dashboard has its own (non hooks-based) display mechanism

There is also some cross-referencing - utils.ShowError calls statushooks.StatusDone(ctx) to stop any ongoing status hooks. This is a bit of a confusion of concerns - ShowError should just show the error

For now it has been moved to status_hooks passage to avoid circular refs

Ideally we need tor simplify the hooks to be consistent - and to facilitate showing warnings at any time in the appropriate manner

kaidaguerre avatar Sep 08 '22 12:09 kaidaguerre