Repository navigation
Retry avatar download after a failed attempt - #495
Lars Vogel (vogella) wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
🟢 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
Sheng Chen (jdneo)
left a comment
There was a problem hiding this comment.
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 🤖
120d7c3 to
5e0e194
Compare
|
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. |
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.