From e6f8ae42b59a399265b27cf0de55bd6667cda9c0 Mon Sep 17 00:00:00 2001 From: Lars Vogel Date: Fri, 16 Oct 2026 22:47:06 +0200 Subject: [PATCH] Retry avatar download after a failed attempt MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit AvatarService removed the user's download job from its job map only after a successful download, so a single network failure or unreadable image kept the default avatar for the rest of the session because no new download was ever scheduled. The job now always removes its entry, and an SWTException from decoding the image is logged like an IOException, so the next chat turn can retry. Assisted-by: multiple AI agents and layers of automated tooling 🤖 --- .../copilot/eclipse/ui/chat/services/AvatarService.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/com.microsoft.copilot.eclipse.ui/src/com/microsoft/copilot/eclipse/ui/chat/services/AvatarService.java b/com.microsoft.copilot.eclipse.ui/src/com/microsoft/copilot/eclipse/ui/chat/services/AvatarService.java index 31e89cd6..e019bea9 100644 --- a/com.microsoft.copilot.eclipse.ui/src/com/microsoft/copilot/eclipse/ui/chat/services/AvatarService.java +++ b/com.microsoft.copilot.eclipse.ui/src/com/microsoft/copilot/eclipse/ui/chat/services/AvatarService.java @@ -14,6 +14,7 @@ import org.eclipse.core.runtime.Status; import org.eclipse.core.runtime.jobs.Job; import org.eclipse.e4.core.services.events.IEventBroker; +import org.eclipse.swt.SWTException; import org.eclipse.swt.graphics.Image; import org.eclipse.swt.widgets.Display; import org.eclipse.ui.PlatformUI; @@ -110,7 +111,7 @@ protected IStatus run(IProgressMonitor monitor) { try (var stream = url.openStream()) { downloadedImage = new Image(display, stream); } - } catch (IOException e) { + } catch (IOException | SWTException e) { CopilotCore.LOGGER.error(e); } if (downloadedImage != null) { @@ -121,8 +122,8 @@ protected IStatus run(IProgressMonitor monitor) { downloadedImage.dispose(); } avatarCache.put(user, result); - jobs.remove(user); } + jobs.remove(user); return Status.OK_STATUS; } };