From adb56b9a30cba0a8f6d40f970527b096bae4d580 Mon Sep 17 00:00:00 2001 From: Ale Mercado Date: Mon, 20 Apr 2026 11:21:40 -0400 Subject: [PATCH 1/3] fix: add debug logging and retry support to icon upload --- internal/api/icon.go | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/internal/api/icon.go b/internal/api/icon.go index 56531666..471bc93f 100644 --- a/internal/api/icon.go +++ b/internal/api/icon.go @@ -135,32 +135,24 @@ func (c *Client) uploadIcon(ctx context.Context, fs afero.Fs, token, appID, icon var userAgent = fmt.Sprintf("slack-cli/%s (os: %s)", cliVersion, runtime.GOOS) request.Header.Add("User-Agent", userAgent) - resp, err := c.httpClient.Do(request) - if err != nil { - return IconResult{}, err - } - defer resp.Body.Close() + c.io.PrintDebug(ctx, "HTTP Request: %v %v", request.Method, request.URL) + c.io.PrintDebug(ctx, "HTTP Request User-Agent: %s", request.Header.Get("User-Agent")) + c.io.PrintDebug(ctx, "HTTP Request Body: ", body.Len()) - span.SetTag("status_code", resp.StatusCode) - - respBody, err := io.ReadAll(resp.Body) + respBytes, err := c.DoWithRetry(ctx, request, span, false, sURL) if err != nil { return IconResult{}, err } var result iconResponse - err = json.Unmarshal(respBody, &result) + err = json.Unmarshal(respBytes, &result) if err != nil { return IconResult{}, err } - span.SetTag("ok", result.Ok) - if !result.Ok { - span.SetTag("error", result.Error) return IconResult{}, fmt.Errorf("%s error: %s", sURL.String(), result.Error) } - // return result return IconResult{}, nil } From efeebc95e915dcc71439161bbc695f8fac2576ab Mon Sep 17 00:00:00 2001 From: Ale Mercado <104795114+srtaalej@users.noreply.github.com> Date: Mon, 20 Apr 2026 15:59:42 -0400 Subject: [PATCH 2/3] Update internal/api/icon.go Co-authored-by: Eden Zimbelman --- internal/api/icon.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/api/icon.go b/internal/api/icon.go index 471bc93f..20210e10 100644 --- a/internal/api/icon.go +++ b/internal/api/icon.go @@ -135,7 +135,7 @@ func (c *Client) uploadIcon(ctx context.Context, fs afero.Fs, token, appID, icon var userAgent = fmt.Sprintf("slack-cli/%s (os: %s)", cliVersion, runtime.GOOS) request.Header.Add("User-Agent", userAgent) - c.io.PrintDebug(ctx, "HTTP Request: %v %v", request.Method, request.URL) + c.io.PrintDebug(ctx, "HTTP Request: %v %v %v", request.Method, request.URL, request.Proto) c.io.PrintDebug(ctx, "HTTP Request User-Agent: %s", request.Header.Get("User-Agent")) c.io.PrintDebug(ctx, "HTTP Request Body: ", body.Len()) From c09d7959411a10ea88b9e9008dae0d1545058bf1 Mon Sep 17 00:00:00 2001 From: Ale Mercado Date: Mon, 20 Apr 2026 16:07:37 -0400 Subject: [PATCH 3/3] remove uploading icon --- internal/pkg/apps/install.go | 3 --- 1 file changed, 3 deletions(-) diff --git a/internal/pkg/apps/install.go b/internal/pkg/apps/install.go index 1e3ee7df..9dcd68ee 100644 --- a/internal/pkg/apps/install.go +++ b/internal/pkg/apps/install.go @@ -531,7 +531,6 @@ func InstallLocalApp(ctx context.Context, clients *shared.ClientFactory, orgGran } } if iconPath != "" { - clients.IO.PrintDebug(ctx, "uploading icon") _, iconErr := clients.API().IconSet(ctx, clients.Fs, token, app.AppID, iconPath) if iconErr != nil { clients.IO.PrintDebug(ctx, "icon error: %s", iconErr) @@ -656,8 +655,6 @@ func updateIcon(ctx context.Context, clients *shared.ClientFactory, iconPath, ap span, ctx = opentracing.StartSpanFromContext(ctx, "updateIcon") defer span.Finish() - clients.IO.PrintDebug(ctx, "uploading icon") - var err error if clients.Config.WithExperimentOn(experiment.SetIcon) { _, err = clients.API().IconSet(ctx, clients.Fs, token, appID, iconPath)