Repository navigation
Stop reporting refused external avatars to Sentry - #12020
Merged
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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