From af945c5860b2d738e122fa16e25735bef8e58d7e Mon Sep 17 00:00:00 2001 From: BigBoss Date: Sun, 30 Jul 2023 16:22:31 -0400 Subject: [PATCH 1/2] =?UTF-8?q?hack:=20=F0=9F=98=B4=20sleep=20enough=20for?= =?UTF-8?q?=20cli=20debug=20p2p?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/client/cli/debug.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/client/cli/debug.go b/app/client/cli/debug.go index 99d5b83de..85a247140 100644 --- a/app/client/cli/debug.go +++ b/app/client/cli/debug.go @@ -2,6 +2,7 @@ package cli import ( "os" + "time" "github.com/manifoldco/promptui" "github.com/spf13/cobra" @@ -50,7 +51,10 @@ func newDebugUISubCommands() []*cobra.Command { Use: promptItem, PersistentPreRunE: helpers.P2PDependenciesPreRunE, Run: func(cmd *cobra.Command, _ []string) { + // TECHDEBT: this is a magic number, but an alternative would be to have the p2p module wait until connections are open and to flush the message correctly + time.Sleep(500 * time.Millisecond) // give p2p module time to start handleSelect(cmd, cmd.Use) + time.Sleep(500 * time.Millisecond) // give p2p module time to broadcast }, ValidArgs: items, } @@ -61,7 +65,7 @@ func newDebugUISubCommands() []*cobra.Command { // newDebugUICommand returns the cobra CLI for the Debug UI interface. func newDebugUICommand() *cobra.Command { return &cobra.Command{ - Aliases: []string{"dui"}, + Aliases: []string{"dui", "debug"}, Use: "DebugUI", Short: "Debug selection ui for rapid development", Args: cobra.MaximumNArgs(0), @@ -154,7 +158,7 @@ func handleSelect(cmd *cobra.Command, selection string) { } broadcastDebugMessage(cmd, m) default: - logger.Global.Error().Msg("Selection not yet implemented...") + logger.Global.Error().Str("selection", selection).Msg("Selection not yet implemented...") } } From 6e0c8ce48174883321fa4aee1e83302efd1a2232 Mon Sep 17 00:00:00 2001 From: BigBoss Date: Mon, 31 Jul 2023 15:33:07 -0700 Subject: [PATCH 2/2] Update app/client/cli/debug.go Co-authored-by: Daniel Olshansky --- app/client/cli/debug.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/client/cli/debug.go b/app/client/cli/debug.go index 85a247140..4cc1ea632 100644 --- a/app/client/cli/debug.go +++ b/app/client/cli/debug.go @@ -51,7 +51,7 @@ func newDebugUISubCommands() []*cobra.Command { Use: promptItem, PersistentPreRunE: helpers.P2PDependenciesPreRunE, Run: func(cmd *cobra.Command, _ []string) { - // TECHDEBT: this is a magic number, but an alternative would be to have the p2p module wait until connections are open and to flush the message correctly + // TECHDEBT(#874): this is a magic number, but an alternative would be to have the p2p module wait until connections are open and to flush the message correctly time.Sleep(500 * time.Millisecond) // give p2p module time to start handleSelect(cmd, cmd.Use) time.Sleep(500 * time.Millisecond) // give p2p module time to broadcast