Skip to content

Stop reporting refused external avatars to Sentry - #12020

Merged
iHiD merged 1 commit into
mainfrom
quiet-avatar-4xx
Oct 28, 2026
Merged

iHiD merged 1 commit into
mainfrom
quiet-avatar-4xx

Conversation

@iHiD

@iHiD iHiD commented Oct 28, 2026

Copy link
Copy Markdown
Member

When the image generator asks for a solution's share data, User::AvatarDataUri fetches the user's external avatar. Some hosts return 403 for some users, and each of those requests was reported to Sentry even though the command already falls back to nil. This change rescues 4xx responses quietly and returns nil as before. 5xx responses, timeouts and other errors are still reported.

I added a test that a 403 returns nil without a Sentry capture. The existing test that a 500 is reported is unchanged. I couldn't run the tests locally because OpenSearch wasn't running, so CI will run them.

Fixes EXERCISM-RAILS-EF.

Closes #9775

🤖 Generated with Claude Code

When an external avatar host returns a 4xx, User::AvatarDataUri now
returns nil without reporting it. 5xx responses, timeouts and other
errors are still reported.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@iHiD
iHiD merged commit 309bd4f into main Oct 28, 2026
29 checks passed
@iHiD
iHiD deleted the quiet-avatar-4xx branch October 28, 2026 12:21
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.

OpenURI::HTTPError: 403 Forbidden (OpenURI::HTTPError)

1 participant