Fix avatar fetch crashes and return generic user icon for TLS certificate issues#7496
Fix avatar fetch crashes and return generic user icon for TLS certificate issues#7496
Conversation
Co-authored-by: alexr00 <38270282+alexr00@users.noreply.github.com>
- Wrap second doFetch() call in try-catch to prevent crashes - Add proper error logging for avatar fetch failures - Return undefined gracefully when avatar fetching fails - Improve user identification in error messages for both accounts and teams - Add test to verify the fix handles TLS errors correctly
alexr00
left a comment
There was a problem hiding this comment.
This PR fixes a critical issue where the VS Code GitHub Pull Request extension would crash when trying to fetch user avatars on networks with edge devices that rewrite TLS certificate chains.
@copilot this is incorrect, the extension doesn't crash the extension, just busts the PR views.
The issue is that if the second try fails, then we return undefined. Instead, we should return a generic user icon.
Fixed in 9119f70. You're correct - instead of returning Warning Firewall rules blocked me from connecting to one or more addressesI tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
Co-authored-by: alexr00 <38270282+alexr00@users.noreply.github.com>
This PR fixes a critical issue where the VS Code GitHub Pull Request extension would break PR views when trying to fetch user avatars on networks with edge devices that rewrite TLS certificate chains.
Problem
Users on corporate networks with edge devices (proxies, firewalls, etc.) that rewrite TLS certificates were experiencing broken PR views with errors like:
The root cause was in the avatar fetching retry logic in
src/common/uri.ts. When the first fetch attempt failed, the code would retry once, but the second attempt was not wrapped in a try-catch block:Solution
The fix implements proper error handling for the retry attempt and returns a generic user icon instead of leaving empty spaces:
Changes Made
doFetch()call in proper try-catchImpact
This ensures users on corporate networks can continue using the extension for all its core functionality (viewing PRs, commenting, reviewing, etc.) even when avatar fetching fails due to network security policies.
Fixes #6196.
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.