From f01c1eea6ac803fff4678abe93f95b4c965e372b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Papp?= Date: Tue, 14 Apr 2026 19:52:07 +0200 Subject: [PATCH] Add timeout to debug bundle upload on Android Use a 2-minute context timeout instead of context.Background() to prevent the upload from blocking indefinitely. --- client/android/client.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/client/android/client.go b/client/android/client.go index c8a92c394..f656e48a0 100644 --- a/client/android/client.go +++ b/client/android/client.go @@ -8,6 +8,7 @@ import ( "os" "slices" "sync" + "time" "golang.org/x/exp/maps" @@ -251,7 +252,10 @@ func (c *Client) DebugBundle(platformFiles PlatformFiles, anonymize bool) (strin } }() - key, err := debug.UploadDebugBundle(context.Background(), types.DefaultBundleURL, cfg.ManagementURL.String(), path) + uploadCtx, cancel := context.WithTimeout(context.Background(), 2*time.Minute) + defer cancel() + + key, err := debug.UploadDebugBundle(uploadCtx, types.DefaultBundleURL, cfg.ManagementURL.String(), path) if err != nil { return "", fmt.Errorf("upload debug bundle: %w", err) }