Skip to content

Retry avatar download after a failed attempt - #495

Open
Lars Vogel (vogella) wants to merge 1 commit into
microsoft:mainfrom
vogellacompany:avatar-retry-after-failure
Open

Lars Vogel (vogella) wants to merge 1 commit into
microsoft:mainfrom
vogellacompany:avatar-retry-after-failure

Conversation

@vogella

@vogella Lars Vogel (vogella) commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

AvatarService removed a user's download job from its job map only after a successful download. A single network failure, or an image SWT could not decode, therefore left the entry in place, no further download was ever scheduled, and the chat showed the default avatar for the rest of the session. The job now always removes its entry and logs an SWTException from decoding like an IOException, so the next chat turn retries the download. After a failed attempt the next download waits at least five minutes, so a permanently failing URL cannot trigger a request for every chat turn.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The targeted fix addresses both failure paths without changing successful caching; builds and tests were not run.

No open issues 🎉

What changed in this PR

Restores avatar download retries in Eclipse chat after network or image-decoding failures.

Changes:

  • Removes the job-map entry after both successful downloads and handled failures.
  • Logs SWT image-decoding exceptions alongside I/O exceptions.
File Description
com.microsoft.copilot.eclipse.ui/​src/​com/​microsoft/​copilot/​eclipse/​ui/​chat/​services/​AvatarService.java Clears completed jobs so subsequent chat turns can retry failed downloads.

Review effort: Balanced

@jdneo Sheng Chen (jdneo) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Though with this patch we can recover a download job which is accidentally failed. But what if for a broken url? The current change will make it trigger a job will will be failed endlessly.

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. The job now always removes its entry, logs an SWTException from decoding like an IOException, and waits five minutes before the next attempt, so a permanently failing URL cannot trigger a download for every chat turn.

Assisted-by: multiple AI agents and layers of automated tooling 🤖
@vogella

Copy link
Copy Markdown
Contributor Author

Good point: there was no tight loop, but each new chat turn started another download, so a permanently failing URL was requested and logged again and again. I added a 5-minute cooldown between attempts, which limits a broken URL to about 12 requests per hour and still recovers from temporary network failures.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants